From 8771fd1880e723173e53ae17056c68070da45af1 Mon Sep 17 00:00:00 2001 From: delivan Date: Mon, 12 Dec 2022 15:33:39 +0900 Subject: [PATCH 1/2] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 695d7f3..2487369 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ TWITTER_AUTH_CALLBACK_URI=... IRON_PASSWORD=... -ICNS_VERIFIER_URI=... +# must be separated by commas +ICNS_VERIFIER_ORIGIN_LIST=http:localhost:8080,http://localhost:8081 ``` Run the development server: From f16159d18964f28720b185cdc0240bb816b9add2 Mon Sep 17 00:00:00 2001 From: delivan Date: Mon, 12 Dec 2022 15:48:34 +0900 Subject: [PATCH 2/2] Add session destruction when re-signin --- pages/api/twitter-auth-url.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/api/twitter-auth-url.ts b/pages/api/twitter-auth-url.ts index 5d82b7e..cb90bfa 100644 --- a/pages/api/twitter-auth-url.ts +++ b/pages/api/twitter-auth-url.ts @@ -23,6 +23,8 @@ export default withIronSessionApiRoute(async function handler( } try { + req.session.destroy(); + const codeVerifier = base64URLEncode(crypto.randomBytes(32)); req.session.code_verifier = codeVerifier; await req.session.save();