From 42e6766388ebd36011deabdbd4ab2a0683937f4a Mon Sep 17 00:00:00 2001 From: rca Date: Sun, 16 Jun 2024 16:47:21 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=88=E3=83=BC=E3=82=AF=E3=83=B3=E7=99=BA?= =?UTF-8?q?=E8=A1=8Cutil=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/tokenUtils.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/utils/tokenUtils.ts diff --git a/src/utils/tokenUtils.ts b/src/utils/tokenUtils.ts new file mode 100644 index 0000000..5e6fcd6 --- /dev/null +++ b/src/utils/tokenUtils.ts @@ -0,0 +1,12 @@ +import jsonwebtoken from "jsonwebtoken"; + +function issueToken(payload: object) { + return jsonwebtoken.sign(payload, "secret"); +} + +function issueTokenByUserId(userId: string) { + return issueToken({ userId }); +} + +export { issueTokenByUserId }; +