mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[AAE-12521] Provide guard in root
This commit is contained in:
@@ -27,7 +27,6 @@ import { AuthRoutingModule } from './auth-routing.module';
|
|||||||
import { AuthService } from './auth.service';
|
import { AuthService } from './auth.service';
|
||||||
import { RedirectAuthService } from './redirect-auth.service';
|
import { RedirectAuthService } from './redirect-auth.service';
|
||||||
import { AuthenticationConfirmationComponent } from './view/authentication-confirmation/authentication-confirmation.component';
|
import { AuthenticationConfirmationComponent } from './view/authentication-confirmation/authentication-confirmation.component';
|
||||||
import { OidcAuthGuard } from './oidc-auth.guard';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a Login Factory function
|
* Create a Login Factory function
|
||||||
@@ -61,8 +60,7 @@ export function loginFactory(oAuthService: OAuthService, storage: OAuthStorage,
|
|||||||
useFactory: loginFactory,
|
useFactory: loginFactory,
|
||||||
deps: [OAuthService, OAuthStorage, AUTH_CONFIG],
|
deps: [OAuthService, OAuthStorage, AUTH_CONFIG],
|
||||||
multi: true
|
multi: true
|
||||||
},
|
}
|
||||||
OidcAuthGuard
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class AuthModule {
|
export class AuthModule {
|
||||||
|
@@ -20,7 +20,9 @@ import { CanActivate, UrlTree } from '@angular/router';
|
|||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { AuthService } from './auth.service';
|
import { AuthService } from './auth.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
export class OidcAuthGuard implements CanActivate {
|
export class OidcAuthGuard implements CanActivate {
|
||||||
constructor(private auth: AuthService) {}
|
constructor(private auth: AuthService) {}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user