Skip to content
Snippets Groups Projects
Commit 069bde6a authored by Mohammad Torkashvand's avatar Mohammad Torkashvand
Browse files

refactor jwt code

parent dc7c3257
No related branches found
No related tags found
No related merge requests found
Pipeline #89038 passed
...@@ -121,11 +121,13 @@ export const authOptions: AuthOptions = { ...@@ -121,11 +121,13 @@ export const authOptions: AuthOptions = {
async jwt({ token, account, profile }): Promise<JWT> { async jwt({ token, account, profile }): Promise<JWT> {
// The "account" is only available right after signing in -- adding useful data to the token // The "account" is only available right after signing in -- adding useful data to the token
if (account) { if (account) {
token.accessToken = account.access_token; return {
token.refreshToken = account.refresh_token; ...token,
token.accessTokenExpires = account.expires_at as number; accessToken: account.access_token,
refreshToken: account.refresh_token,
token.profile = profile as WfoUserProfile; accessTokenExpires: account.expires_at as number,
profile: profile as WfoUserProfile,
};
} }
const now = Math.floor(Date.now() / 1000); const now = Math.floor(Date.now() / 1000);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment