|
|
@ -493,13 +493,14 @@ export class UsersService { |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async signout(param: { res: any; req: any }) { |
|
|
|
async signOut(param: { res: any; req: any }) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
param.res.clearCookie('refresh_token'); |
|
|
|
param.res.clearCookie('refresh_token'); |
|
|
|
const user = (param.req as any).user; |
|
|
|
const user = (param.req as any).user; |
|
|
|
if (user) { |
|
|
|
if (user?.id) { |
|
|
|
await User.update(user.id, { |
|
|
|
await User.update(user.id, { |
|
|
|
refresh_token: null, |
|
|
|
refresh_token: null, |
|
|
|
|
|
|
|
token_version: null, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
return { msg: 'Signed out successfully' }; |
|
|
|
return { msg: 'Signed out successfully' }; |
|
|
|