Added logout functionality with CIAM
This commit is contained in:
@@ -2,6 +2,7 @@ export interface Environment {
|
||||
environment: 'api' | 'local' | 'prod';
|
||||
clientId: string;
|
||||
loginUrl: string;
|
||||
logoutUrl: string;
|
||||
production: boolean;
|
||||
api: {
|
||||
url: string;
|
||||
|
||||
@@ -81,5 +81,9 @@ export class AuthenticationService {
|
||||
logout(): void {
|
||||
localStorage.removeItem('id_token');
|
||||
localStorage.removeItem('expires_at');
|
||||
|
||||
if (environment.environment !== 'local') {
|
||||
document.location.href = environment.logoutUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ export const environment: Environment = {
|
||||
environment: 'api',
|
||||
clientId: '5d08c2e4-763e-42f6-b858-24e4773bb83d',
|
||||
loginUrl: 'https://ciam-test.arbetsformedlingen.se:8443/uas/oauth2/authorization?response_type=code&scope=openid',
|
||||
logoutUrl: 'https://ciam-test.arbetsformedlingen.se:8443/uas/logout',
|
||||
production: false,
|
||||
api: {
|
||||
url: '/api',
|
||||
|
||||
@@ -3,7 +3,8 @@ import { Environment } from '@msfa-models/environment.model';
|
||||
export const environment: Environment = {
|
||||
environment: 'prod',
|
||||
clientId: '',
|
||||
loginUrl: 'https://ciam.arbetsformedlingen.se/',
|
||||
loginUrl: 'https://ciam.arbetsformedlingen.se/uas/oauth2/authorization?response_type=code&scope=openid',
|
||||
logoutUrl: 'https://ciam.arbetsformedlingen.se:8443/uas/logout',
|
||||
production: true,
|
||||
api: {
|
||||
url: '/api',
|
||||
|
||||
@@ -4,6 +4,7 @@ export const environment: Environment = {
|
||||
environment: 'local',
|
||||
clientId: '',
|
||||
loginUrl: '/mock-login',
|
||||
logoutUrl: '',
|
||||
production: false,
|
||||
api: {
|
||||
url: '/api',
|
||||
|
||||
Reference in New Issue
Block a user