mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 11:49:19 +00:00
fix: loggin out keeps refresh token in browser
fix: https://github.com/canove/whaticket/issues/106
This commit is contained in:
@@ -31,9 +31,21 @@ export const update = async (
|
||||
throw new AppError("ERR_SESSION_EXPIRED", 401);
|
||||
}
|
||||
|
||||
const { user, newToken, refreshToken } = await RefreshTokenService(token);
|
||||
const { user, newToken, refreshToken } = await RefreshTokenService(
|
||||
res,
|
||||
token
|
||||
);
|
||||
|
||||
SendRefreshToken(res, refreshToken);
|
||||
|
||||
return res.json({ token: newToken, user });
|
||||
};
|
||||
|
||||
export const remove = async (
|
||||
req: Request,
|
||||
res: Response
|
||||
): Promise<Response> => {
|
||||
res.clearCookie("jrt");
|
||||
|
||||
return res.send();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user