How to use the @nebular/auth.NbDummyAuthStrategy.setup function in @nebular/auth

To help you get started, we’ve selected a few @nebular/auth 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 akveo / nebular / assets / examples / smart-home / app.module.ts View on Github external
import { AppComponent } from './app.component';
import { AppRouting } from './app-routing.module';


@NgModule({
  imports: [
    CommonModule,
    HttpClientModule,
    NbLayoutModule,
    NbCardModule,
    NbButtonModule,
    AppRouting,

    NbAuthModule.forRoot({
      strategies: [
        NbDummyAuthStrategy.setup({
          name: 'email',

          alwaysFail: true,
          delay: 1000,
        }),
      ],
    }),
  ],
  declarations: [
    AppComponent,
  ],
})
export class AppModule {
}
github akveo / nebular / src / framework / auth / services / interceptors / jwt-interceptor.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [HttpClientModule, HttpClientTestingModule, RouterTestingModule],
      providers: [
         { provide: NB_AUTH_FALLBACK_TOKEN, useValue: NbAuthSimpleToken },
         { provide: NB_AUTH_TOKENS, useValue: [NbAuthJWTToken] },
        NbAuthTokenParceler,
         {
          provide: NB_AUTH_USER_OPTIONS, useValue: {
            strategies: [
              NbDummyAuthStrategy.setup({
                alwaysFail: false,
                name: 'dummy',
              }),
            ],
          },
        },
        { provide: NB_AUTH_OPTIONS, useFactory: nbOptionsFactory, deps: [NB_AUTH_USER_OPTIONS] },
        { provide: NB_AUTH_STRATEGIES, useFactory: nbStrategiesFactory, deps: [NB_AUTH_OPTIONS, Injector] },
        { provide: NbTokenStorage, useClass: NbTokenLocalStorage },
        { provide: HTTP_INTERCEPTORS, useClass: NbAuthJWTInterceptor, multi: true },
        { provide: NB_AUTH_TOKEN_INTERCEPTOR_FILTER, useValue: filterInterceptorRequest },
        NbTokenService,
        NbAuthService,
        NbDummyAuthStrategy,
      ],
    });
github akveo / nebular / src / playground / without-layout / smart-home / app.module.ts View on Github external
import { AppComponent } from './app.component';
import { AppRouting } from './app-routing.module';


@NgModule({
  imports: [
    CommonModule,
    HttpClientModule,
    NbLayoutModule,
    NbCardModule,
    NbButtonModule,
    AppRouting,

    NbAuthModule.forRoot({
      strategies: [
        NbDummyAuthStrategy.setup({
          name: 'email',

          alwaysFail: true,
          delay: 1000,
        }),
      ],
    }),
  ],
  declarations: [
    AppComponent,
  ],
})
export class AppModule {
}
github akveo / nebular / src / playground / without-layout / auth / auth.module.ts View on Github external
},
            {
              url: 'https://www.facebook.com/akveo',
              target: '_blank',
              icon: 'home-outline',
            },
            {
              url: 'https://www.facebook.com/akveo',
              target: '_blank',
              title: 'Twitter',
            },
          ],
        },
      },
      strategies: [
        NbDummyAuthStrategy.setup({
          name: 'dummy',

          alwaysFail: true,
          delay: 1000,
        }),

        NbPasswordAuthStrategy.setup({
          name: 'email',
          token: {
            class: NbAuthJWTToken,
          },
          login: {
            requireValidToken: false,
          },
          baseEndpoint: 'http://localhost:4400/api/auth/',
          logout: {
github akveo / nebular / 3.6.2 / assets / examples / auth / auth.module.ts View on Github external
},
            {
              url: 'https://www.facebook.com/akveo',
              target: '_blank',
              icon: 'nb-home',
            },
            {
              url: 'https://www.facebook.com/akveo',
              target: '_blank',
              title: 'Twitter',
            },
          ],
        },
      },
      strategies: [
        NbDummyAuthStrategy.setup({
          name: 'dummy',

          alwaysFail: true,
          delay: 1000,
        }),

        NbPasswordAuthStrategy.setup({
          name: 'email',
          token: {
            class: NbAuthJWTToken,
          },
          login: {
            requireValidToken: false,
          },
          baseEndpoint: 'http://localhost:4400/api/auth/',
          logout: {