-
Notifications
You must be signed in to change notification settings - Fork 453
Closed
Description
Version
^18.0.1
Please provide a link to a minimal reproduction of the bug
NA
Please provide the exception or error you saw
NA
Steps to reproduce the behavior
NA
A clear and concise description of what you expected to happen.
We have a usecase where a inital request for a user registration contains a login_hint.
On initialization the application does a checkAuth and validates the login_hint is present in the request and proceeds with a authorize request.
The AutoLoginPartialRoutesGuard overides the Inital Request.
Additional context
app.component.ts:
ngOnInit() {
this.authService.checkAuth().subscribe(({ isAuthenticated}) => {
if(!isAuthenticated){
this.login();
}else{
this.loading = false;
}
});
}
login(){
let url: URL = new URL(window.location.href);
let hint = url.searchParams.get('login_hint')?.toString();
if(!!hint){
this.authService.authorize('',{ customParams: { login_hint: `${hint}` }});
}else{
this.authService.authorize()
}
}app.routes.ts:
export const routes: Routes = [
{ path: '', redirectTo: 'dashboards', pathMatch: 'full' },
{ path: 'callback', component: CallbackComponent },
{
path: 'dashboards',
loadChildren: () =>
import('../app/si-modules/si-dashboards/si-dashboards.module').then(
(module) => module.SiDashboardsModule
),
data: { breadcrumb: 'Dashboards' },
canActivate: [AutoLoginPartialRoutesGuard],
},Configuration:
export const httpLoaderFactory = (httpClient: HttpClient) => {
const config$ = TenantSettings(httpClient).pipe(
map((response: any) => {
return {
postLoginRoute: '/dashboards',
authority: response.authority,
redirectUrl: `${window.location.origin}/callback`,
postLogoutRedirectUri: window.location.origin,
clientId: response.clientId,
scope: response.scope,
responseType: response.responseType,
silentRenew: response.silentRenew, //true
useRefreshToken: response.useRefreshToken, //true
logLevel: LogLevel.Debug,
triggerRefreshWhenIdTokenExpired: true,
ignoreNonceAfterRefresh: true,
};
})
);
return new StsConfigHttpLoader(config$);
};Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels