Skip to content
Snippets Groups Projects
Commit ff5f3197 authored by FORESTIER Fabien's avatar FORESTIER Fabien
Browse files

Add expiration time in userInfo

parent d234d3a3
Branches
Tags
1 merge request!5Version 3.0.0
Pipeline #2613 passed
......@@ -46,7 +46,7 @@ export class UserInfo {
@IsString()
email: string;
@ApiModelProperty({description: 'Encrypted password'})
@ApiModelProperty({ description: 'Encrypted password' })
@IsString()
authzKey: string;
}
......@@ -67,6 +67,10 @@ export class PublicUserInfo {
@ApiModelProperty()
@IsString()
email: string;
@ApiModelProperty()
@IsNumber()
exp: number;
}
export class JwtInfo extends UserInfo {
......
......@@ -109,6 +109,8 @@ export class AuthenticationService {
publicInfo.lastName = userInfo.lastName;
publicInfo.username = userInfo.username;
publicInfo.email = userInfo.email;
// Set expiration for user info, conrresponds to the current time + the jwt life time variable set in milliseconds
publicInfo.exp = Date.now() + (this.conf.jwtLifetime * 1000);
return { jwtToken, userInfo: publicInfo, xsrfToken: jwtInfo.xsrfToken };
} catch (error) {
......
  • Fabien FORESTIER @ext.sopra.fforestier

    mentioned in commit 334bb742

    By Fabien Forestier on 2019-10-11T14:36:02 (imported from GitLab project)

    ·

    mentioned in commit 334bb742

    By Fabien Forestier on 2019-10-11T14:36:02 (imported from GitLab project)

    Toggle commit list
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment