Skip to content

Commit fec6bba

Browse files
authored
Merge pull request #38 from kc3hack/toaru-done
done
2 parents 363da88 + b000859 commit fec6bba

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

Backend/Workspace/Routes/Login.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ router.get(
5757
* - DBからユーザー情報を取得
5858
* - ハッシュ検証後にクッキーを発行
5959
*/
60-
router.post("/Submit", InverseVCM('LOGIN_TOKEN', process.env.LOGIN_SECRET), async (req, res) => {
60+
router.post("/Submit", async (req, res) => {
6161

6262
// 0. 処理開始ログ
6363
console.log("/Login/Submit-API is running!");

Backend/Workspace/Routes/Register.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,17 @@ router.post(
178178
parallelism: 1
179179
});
180180

181+
// 4. Cookie発行
182+
CreateCookie({
183+
res,
184+
cookieName: 'LOGIN_TOKEN',
185+
payload: { userId, address: address },
186+
secretKey: process.env.LOGIN_SECRET,
187+
deadlineHours: 24, // 1日有効
188+
httpOnly: true,
189+
sameSite: 'strict'
190+
});
191+
181192

182193
// =====================================================
183194
// 5. DB保存

0 commit comments

Comments
 (0)