remove keycloak

This commit is contained in:
2025-02-19 16:24:42 -06:00
parent a2e6243e93
commit f6d1b8623c
26 changed files with 166 additions and 282 deletions

View File

@@ -6,39 +6,6 @@ const logger = createLogger('AuthGuard');
@Injectable({
providedIn: 'root',
})
// export class AuthGuard extends KeycloakAuthGuard {
// constructor(protected override readonly router: Router, protected readonly keycloak: KeycloakService, private keycloakInitializer: KeycloakInitializerService) {
// super(router, keycloak);
// }
// async isAccessAllowed(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {
// logger.info(`--->AuthGuard`);
// while (!this.keycloakInitializer.initialized) {
// logger.info(`Waiting 100 msec`);
// await new Promise(resolve => setTimeout(resolve, 100));
// }
// // Force the user to log in if currently unauthenticated.
// const authenticated = this.keycloak.isLoggedIn();
// //this.keycloak.isTokenExpired()
// if (!this.authenticated && !authenticated) {
// await this.keycloak.login({
// redirectUri: window.location.origin + state.url,
// });
// // return false;
// }
// // Get the roles required from the route.
// const requiredRoles = route.data['roles'];
// // Allow the user to proceed if no additional roles are required to access the route.
// if (!Array.isArray(requiredRoles) || requiredRoles.length === 0) {
// return true;
// }
// // Allow the user to proceed if all the required roles are present.
// return requiredRoles.every(role => this.roles.includes(role));
// }
// }
export class AuthGuard implements CanActivate {
constructor(private authService: AuthService, private router: Router) {}