Skip to content

Commit 462bdbb

Browse files
author
Bruno Krebs
committed
removing useless parameter and fixing code related to the expiration of id tokens;
1 parent 16ded9d commit 462bdbb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

frontend/src/Auth.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Auth {
88
audience: 'https://bk-tmp.auth0.com/userinfo',
99
clientID: 'PVafIu9Q5QN65DiPByAFvCCJryY7n432',
1010
redirectUri: 'http://localhost:3000/callback',
11-
responseType: 'token id_token',
11+
responseType: 'id_token',
1212
scope: 'openid profile'
1313
});
1414

@@ -48,11 +48,11 @@ class Auth {
4848
})
4949
}
5050

51-
setSession(authResult, step) {
51+
setSession(authResult) {
5252
this.idToken = authResult.idToken;
5353
this.profile = authResult.idTokenPayload;
5454
// set the time that the id token will expire at
55-
this.expiresAt = authResult.expiresIn * 1000 + new Date().getTime();
55+
this.expiresAt = authResult.idTokenPayload.exp * 1000;
5656
}
5757

5858
signOut() {

0 commit comments

Comments
 (0)