How to use @auth0/angular-jwt - 10 common examples

To help you get started, we’ve selected a few @auth0/angular-jwt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mprove-io / mprove / src / app / app.module.ts View on Github external
'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,
github Fundator / IMO-Maritime-Single-Window / IMOMaritimeSingleWindow / Client / src / app / shared / services / login.service.ts View on Github external
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('')
    });
  }
github itea-dev / ng-thingsboard / src / app / app.module.ts View on Github external
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 { }
github sschocke / angular-jwt-todo / client / src / app / app.module.ts View on Github external
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 { }
github ceph / ceph / src / pybind / mgr / dashboard / frontend / src / app / app.module.ts View on Github external
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,
github electronicarts / ava-capture / website-frontend / src / app / app.module.ts View on Github external
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) {
github chrisleekr / yii2-angular-boilerplate / backend / src / app / app.module.ts View on Github external
@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,
github TryCatchLearn / DatingApp30 / DatingApp-SPA / src / app / app.module.ts View on Github external
],
  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 }
github GCE-NEIIST / GCE-NEIIST-webapp / angular-src / src / app / app.module.ts View on Github external
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,
github tidusjar / Ombi / src / Ombi / ClientApp / app / app.module.ts View on Github external
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,

@auth0/angular-jwt

JSON Web Token helper library for Angular

MIT
Latest version published 1 year ago

Package Health Score

73 / 100
Full package analysis