Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'https://3f5855e2b10b4c4c8b786ff69c1fe3a6@sentry.io/1208233'
).install();
}
@NgModule({
declarations: [AppComponent, ...APP_DIALOGS],
entryComponents: [...APP_DIALOGS],
imports: [
EffectsModule.forRoot(APP_EFFECTS),
MyMaterialModule,
ReactiveFormsModule,
FlexLayoutModule,
SharedModule,
SpaceModule,
HttpClientModule,
JwtModule.forRoot({
config: {
headerName: 'Authorization',
authScheme: 'Bearer ',
tokenGetter: helper.getToken, // for jwtInterceptor
whitelistedDomains: [
'localhost',
'localhost:4200',
'localhost:8080',
'test.mprove.io',
'stage.mprove.io',
'mprove.io'
]
}
}),
MyCovalentModule,
ClipboardModule,
constructor(
private http: HttpClient,
private configService: ConfigService,
private jwtHelperService: JwtHelperService
) {
super();
this.loggedIn = !!localStorage.getItem('auth_token');
// ?? not sure if this the best way to broadcast the status but seems to resolve issue on page refresh where auth status is lost in
// header component resulting in authed user nav links disappearing despite the fact user is still logged in
this._authNavStatusSource.next(this.loggedIn);
this.baseUrl = configService.getApiURI();
this.jwtHelperService = new JwtHelperService({
tokenGetter: () => localStorage.getItem('')
});
}
AppComponent,
],
imports: [
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule,
CoreModule,
SharedModule,
CdkTableModule,
CdkTreeModule,
DragDropModule,
ScrollingModule,
LayoutModule,
HttpClientModule,
JwtModule.forRoot({
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
}
})
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
return localStorage.getItem('access_token');
}
@NgModule({
declarations: [
AppComponent,
TodoListComponent,
UserListComponent,
LoginComponent
],
imports: [
BrowserModule,
AppRoutingModule,
HttpClientModule,
FormsModule,
JwtModule.forRoot({
config: {
tokenGetter: tokenGetter,
whitelistedDomains: ['localhost:4000'],
blacklistedRoutes: ['localhost:4000/api/auth']
}
})
],
providers: [
TodoService,
UserService,
AuthService,
AuthGuard
],
bootstrap: [AppComponent]
})
export class AppModule { }
BlockUIModule.forRoot(),
BrowserModule,
BrowserAnimationsModule,
ToastrModule.forRoot({
positionClass: 'toast-top-right',
preventDuplicates: true,
enableHtml: true
}),
AppRoutingModule,
CoreModule,
SharedModule,
CephModule,
AccordionModule.forRoot(),
BsDropdownModule.forRoot(),
TabsModule.forRoot(),
JwtModule.forRoot({
config: {
tokenGetter: jwtTokenGetter
}
}),
NgBootstrapFormValidationModule.forRoot(),
SidebarModule.forRoot(),
WebStorageModule
],
exports: [SharedModule],
providers: [
{
provide: ErrorHandler,
useClass: JsErrorHandler
},
{
provide: HTTP_INTERCEPTORS,
redirectTo: '/app/frontpage',
pathMatch: 'full'
},
{ path: '**', redirectTo: '/app/frontpage' },
];
@NgModule({
imports: [
BrowserModule,
HttpModule,
CoreModule,
LoginModule,
ErrorModule,
RouterModule.forRoot(appRoutes, { useHash: true }),
HttpClientModule,
JwtModule.forRoot({
config: {
tokenGetter: tokenGetter,
headerName: 'Authorization',
authScheme: 'JWT '
//,
//whitelistedDomains: ['localhost:3001'],
//blacklistedRoutes: [/.*\/accounts\/logout/]
}
}) ],
providers: [ NotificationService, UserService, LoggedInGuard, ConfigService ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule {
constructor(private router: Router, private userService : UserService) {
@NgModule({
declarations: [
AppComponent,
BackendLayoutComponent,
SimpleLayoutComponent,
P404Component
],
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
HttpClientModule,
SharedModule,
BsDropdownModule.forRoot(),
JwtModule.forRoot({
config: {
tokenGetter: tokenGetter,
whitelistedDomains: [environment.apiHost]
}
})
],
providers: [
{
provide: LocationStrategy,
useClass: HashLocationStrategy
},
AuthGuard,
StaffService,
StaffDataService,
GlobalService,
SettingDataService,
],
imports: [
BrowserModule,
BrowserAnimationsModule,
HttpClientModule,
FormsModule,
ReactiveFormsModule,
BsDropdownModule.forRoot(),
BsDatepickerModule.forRoot(),
ButtonsModule.forRoot(),
PaginationModule.forRoot(),
TabsModule.forRoot(),
RouterModule.forRoot(appRoutes),
NgxGalleryModule,
FileUploadModule,
JwtModule.forRoot({
config: {
tokenGetter,
whitelistedDomains: ['localhost:5000'],
blacklistedRoutes: ['localhost:5000/api/auth']
}
})
],
providers: [
ErrorInterceptorProvider,
MemberDetailResolver,
MemberListResolver,
MemberEditResolver,
ListsResolver,
MessagesResolver,
PreventUnsavedChanges,
{ provide: HAMMER_GESTURE_CONFIG, useClass: CustomHammerConfig }
PartnersCarouselComponent,
AboutUsComponent,
GceArticlesComponent,
GetAdviceComponent,
PartnersCarouselComponent
],
imports: [
BrowserModule,
ChatModule,
FormsModule,
HttpModule,
NgbModule,
ReactiveFormsModule,
ChartsModule,
JwtModule.forRoot({
config: {
whitelistedDomains: ['localhost:3001', 'localhost:8080', 'gce-neiist.org',
'gce-neiist-development.herokuapp.com', 'gce-neiist-staging.herokuapp.com/',
'fenix.tecnico.ulisboa.pt/oauth, maps.googleapis.com']
}
}),
RouterModule.forRoot(appRoutes),
AgmCoreModule.forRoot({
apiKey: Vars.GOOGLE_MAPS,
}),
FlashMessagesModule,
],
providers: [
ValidateService,
AuthService,
StudentService,
DataTableModule,
SharedModule,
NgxEditorModule,
DialogModule,
MatButtonModule,
NgbModule.forRoot(),
MatCardModule,
MatInputModule,
MatTabsModule,
ReactiveFormsModule,
CaptchaModule,
TooltipModule,
ConfirmDialogModule,
OverlayPanelModule,
CommonModule,
JwtModule.forRoot({
config: {
tokenGetter: JwtTokenGetter,
},
}),
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient, PlatformLocation],
},
}),
SidebarModule,
],
declarations: [
AppComponent,
PageNotFoundComponent,