Commit 80956839 authored by François Agneray's avatar François Agneray
Browse files

Add redirect uri variables

parent 0eb7e3f8
Pipeline #3400 passed with stages
in 8 minutes
...@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core'; ...@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
import { from } from 'rxjs'; import { from } from 'rxjs';
import { switchMap, map, tap } from 'rxjs/operators'; import { switchMap, map, tap } from 'rxjs/operators';
import { Action } from '@ngrx/store';
import { Effect, Actions, ofType } from '@ngrx/effects'; import { Effect, Actions, ofType } from '@ngrx/effects';
import { KeycloakService } from 'keycloak-angular'; import { KeycloakService } from 'keycloak-angular';
...@@ -19,13 +18,15 @@ export class AuthEffects { ...@@ -19,13 +18,15 @@ export class AuthEffects {
@Effect({ dispatch: false }) @Effect({ dispatch: false })
loginAction$ = this.actions$.pipe( loginAction$ = this.actions$.pipe(
ofType(authActions.LOGIN), ofType(authActions.LOGIN),
tap(_ => this.keycloak.login()) tap(_ => this.keycloak.login({
redirectUri: window.location.origin + environment.ssoLogoutRedirectUri
}))
); );
@Effect({ dispatch: false }) @Effect({ dispatch: false })
logoutAction$ = this.actions$.pipe( logoutAction$ = this.actions$.pipe(
ofType(authActions.LOGOUT), ofType(authActions.LOGOUT),
tap(_ => this.keycloak.logout(window.location.origin + '/login')) tap(_ => this.keycloak.logout(window.location.origin + environment.ssoLogoutRedirectUri))
); );
@Effect() @Effect()
......
...@@ -5,5 +5,7 @@ export const environment = { ...@@ -5,5 +5,7 @@ export const environment = {
settingsUrl: '/settings', settingsUrl: '/settings',
ssoAuthUrl: 'https://anis-dev.lam.fr/auth', ssoAuthUrl: 'https://anis-dev.lam.fr/auth',
ssoRealm: 'anis', ssoRealm: 'anis',
ssoClientId: 'anis-admin' ssoClientId: 'anis-admin',
ssoLoginRedirectUri: '/admin',
ssoLogoutRedirectUri: '/admin/login'
}; };
...@@ -9,7 +9,9 @@ export const environment = { ...@@ -9,7 +9,9 @@ export const environment = {
settingsUrl: 'http://localhost:8082', settingsUrl: 'http://localhost:8082',
ssoAuthUrl: 'http://localhost:8180/auth', ssoAuthUrl: 'http://localhost:8180/auth',
ssoRealm: 'anis', ssoRealm: 'anis',
ssoClientId: 'anis-admin' ssoClientId: 'anis-admin',
ssoLoginRedirectUri: '/',
ssoLogoutRedirectUri: '/login'
}; };
/* /*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment