mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-10 14:11:42 +00:00
tmp use forRoot argument to provide custom oauthstorage service
This commit is contained in:
@@ -45,7 +45,6 @@ export function loginFactory(redirectService: RedirectAuthService): () => Promis
|
|||||||
declarations: [AuthenticationConfirmationComponent],
|
declarations: [AuthenticationConfirmationComponent],
|
||||||
imports: [AuthRoutingModule, OAuthModule.forRoot()],
|
imports: [AuthRoutingModule, OAuthModule.forRoot()],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: OAuthStorage, useExisting: JWT_STORAGE_SERVICE },
|
|
||||||
{ provide: AuthenticationService},
|
{ provide: AuthenticationService},
|
||||||
{
|
{
|
||||||
provide: AUTH_CONFIG,
|
provide: AUTH_CONFIG,
|
||||||
@@ -63,11 +62,14 @@ export function loginFactory(redirectService: RedirectAuthService): () => Promis
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class AuthModule {
|
export class AuthModule {
|
||||||
static forRoot(config: AuthModuleConfig = { useHash: false }): ModuleWithProviders<AuthModule> {
|
static forRoot(config: AuthModuleConfig = { useHash: false }, jwtStorage?: typeof OAuthStorage): ModuleWithProviders<AuthModule> {
|
||||||
config.preventClearHashAfterLogin = config.preventClearHashAfterLogin ?? true;
|
config.preventClearHashAfterLogin = config.preventClearHashAfterLogin ?? true;
|
||||||
return {
|
return {
|
||||||
ngModule: AuthModule,
|
ngModule: AuthModule,
|
||||||
providers: [{ provide: AUTH_MODULE_CONFIG, useValue: config }]
|
providers: [
|
||||||
|
{ provide: AUTH_MODULE_CONFIG, useValue: config },
|
||||||
|
{ provide: OAuthStorage, useExisting: jwtStorage ?? StorageService }
|
||||||
|
]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user