This commit is contained in:
Edouard DUPIN 2022-06-06 15:07:33 +02:00
parent 5f8fd477e0
commit a50e9535e0

View File

@ -33,8 +33,8 @@ declare function SHA512(param1: any): any;
export class UserService { export class UserService {
// 0: Not hide password; 1 hide password; // 0: Not hide password; 1 hide password;
private identificationVersion: number = 1; private identificationVersion: number = 1;
private cookiesRememberMe = 'karauth-remember-me'; private cookiesRememberMe = 'remember-me';
private cookiesToken = 'karauth-token'; private cookiesToken = 'token';
constructor( constructor(
private storageService: StorageService, private storageService: StorageService,
@ -86,11 +86,13 @@ export class UserService {
// And in the mlain application position, the route does not have curently root the page // And in the mlain application position, the route does not have curently root the page
let pathName = window.location.pathname; let pathName = window.location.pathname;
console.log("start Path-name: '" + pathName + "'"); console.log("start Path-name: '" + pathName + "'");
console.log("check with: '" + environment.applName + "/sso/" + "'");
if (pathName.startsWith("/sso/") || pathName.startsWith(environment.applName + "/sso/")) { if (pathName.startsWith("/sso/") || pathName.startsWith(environment.applName + "/sso/")) {
console.log(" ==> SSo section"); console.log(" ==> SSo section");
reject(); reject();
return; return;
} }
console.log(" ==> Check if need reconnect?");
let rememberMe = self.storageService.get(self.cookiesRememberMe)==="true"; let rememberMe = self.storageService.get(self.cookiesRememberMe)==="true";
// TODO: in case of jest reload ==> no need to manage the SSO ==> just keep the token ... it in enought... // TODO: in case of jest reload ==> no need to manage the SSO ==> just keep the token ... it in enought...
let token = self.storageService.getSession(self.cookiesToken); let token = self.storageService.getSession(self.cookiesToken);
@ -108,6 +110,7 @@ export class UserService {
self.ssoService.requestSignIn(); self.ssoService.requestSignIn();
reject(); reject();
} }
resolve();
} }
}); });
} }