From 152cb381ea2c915c762416092337ce1d8589d1c6 Mon Sep 17 00:00:00 2001 From: Aijana Schumann Date: Mon, 6 Dec 2021 15:09:15 +0100 Subject: Update ODLUX Update login view, add logout after user session ends, add user settings, several bugfixes Issue-ID: CCSDK-3540 Signed-off-by: Aijana Schumann Change-Id: I21137756b204287e25766a9646bf2faf7bad9d35 --- sdnr/wt/odlux/framework/src/services/authenticationService.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sdnr/wt/odlux/framework/src/services/authenticationService.ts') diff --git a/sdnr/wt/odlux/framework/src/services/authenticationService.ts b/sdnr/wt/odlux/framework/src/services/authenticationService.ts index 4e7d109d9..a7691bf6f 100644 --- a/sdnr/wt/odlux/framework/src/services/authenticationService.ts +++ b/sdnr/wt/odlux/framework/src/services/authenticationService.ts @@ -24,6 +24,7 @@ type AuthTokenResponse = { access_token: string; token_type: string; expires_at: number; + issued_at: number; } class AuthenticationService { @@ -50,11 +51,14 @@ class AuthenticationService { scope: scope }) }, false); + + return result && { username: email, access_token: result.access_token, token_type: result.token_type, - expires: (result.expires_at * 1000) + expires: result.expires_at, + issued: result.issued_at } || null; } @@ -65,12 +69,14 @@ class AuthenticationService { 'Authorization': "Basic " + btoa(email + ":" + password) }, }, false); + if (result) { return { username: email, access_token: btoa(email + ":" + password), token_type: "Basic", - expires: (new Date()).valueOf() + 2678400000 // 31 days + expires: (new Date()).valueOf() / 1000 + 86400, // 1 day + issued: (new Date()).valueOf() / 1000 } } return null; -- cgit 1.2.3-korg