mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Replace generic error with BadRequestError for missing refresh token in exchange
This commit is contained in:
@@ -244,9 +244,9 @@ export const checkAuth = async (req: Request, res: Response) => {
|
|||||||
export const getNewToken = async (req: Request, res: Response) => {
|
export const getNewToken = async (req: Request, res: Response) => {
|
||||||
const refreshToken = req.cookies.jid;
|
const refreshToken = req.cookies.jid;
|
||||||
|
|
||||||
if (!refreshToken) {
|
if (!refreshToken) throw BadRequestError({
|
||||||
throw new Error("Failed to find refresh token in request cookies");
|
message: "Failed to find refresh token in request cookies"
|
||||||
}
|
});
|
||||||
|
|
||||||
const decodedToken = <jwt.UserIDJwtPayload>(
|
const decodedToken = <jwt.UserIDJwtPayload>(
|
||||||
jwt.verify(refreshToken, await getJwtRefreshSecret())
|
jwt.verify(refreshToken, await getJwtRefreshSecret())
|
||||||
|
|||||||
Reference in New Issue
Block a user