From aacbb65afa3383ca256fdb57405764e0f2ad3959 Mon Sep 17 00:00:00 2001 From: thanhdanh27600 Date: Sat, 14 Oct 2023 11:11:41 +0700 Subject: [PATCH] fix token --- src/controllers/forward.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/forward.ts b/src/controllers/forward.ts index fccd28b3..433314ca 100644 --- a/src/controllers/forward.ts +++ b/src/controllers/forward.ts @@ -66,11 +66,11 @@ export const handler = api( valid = shortenService.verifyToken(history, token); if (!valid) return res.send({ errorCode: HttpStatusCode.UNAUTHORIZED, errorMessage: 'UNAUTHORIZED' }); - if (history?.email) history.email = ''; - if (history?.password) history.password = ''; - sendMessageToQueue([{ subject: 'forward', body: data }]); shortenCacheService.postShortenHash(history); + + if (history?.email) history.email = ''; + if (history?.password) history.password = ''; return successHandler(res, { history, token: encryptS(history.id.toString()) }); }, ['POST'],