Fix token cookie not being peristed on browser reboot (#2667)

This commit is contained in:
Charles Bochet 2023-11-23 12:16:20 +01:00 committed by GitHub
parent 01172d44dd
commit 9c4f402102
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -32,6 +32,8 @@ export const cookieStorageEffect =
}
isReset
? cookieStorage.removeItem(key)
: cookieStorage.setItem(key, JSON.stringify(newValue));
: cookieStorage.setItem(key, JSON.stringify(newValue), {
expires: new Date(Date.now() + 1000 * 60 * 60 * 24 * 7),
});
});
};

View File

@ -169,8 +169,6 @@ export class AuthService {
user.passwordHash = '';
user.workspaceMember = await this.userService.loadWorkspaceMember(user);
console.log(user.workspaceMember);
const accessToken = await this.tokenService.generateAccessToken(user.id);
const refreshToken = await this.tokenService.generateRefreshToken(user.id);