From fca2ec3e152b896921f0b158135abf94722846ff Mon Sep 17 00:00:00 2001 From: ekzyis Date: Tue, 21 Nov 2023 03:24:47 +0100 Subject: [PATCH] Fix multiAuth type getServerSideProps of /login can only return JSON serializable props which will always be strings. --- pages/api/auth/[...nextauth].js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pages/api/auth/[...nextauth].js b/pages/api/auth/[...nextauth].js index 8b3c4050..2e1ec1ad 100644 --- a/pages/api/auth/[...nextauth].js +++ b/pages/api/auth/[...nextauth].js @@ -114,7 +114,9 @@ function setMultiAuthCookies (req, res, { id, jwt, name, photoId }) { } async function pubkeyAuth (credentials, req, res, pubkeyColumnName) { - const { k1, pubkey, multiAuth } = credentials + const { k1, pubkey, multiAuth: multiAuthParam } = credentials + // multiAuth query param is a string + const multiAuth = typeof multiAuthParam === 'string' ? multiAuthParam === 'true' : !!multiAuthParam try { const lnauth = await prisma.lnAuth.findUnique({ where: { k1 } }) await prisma.lnAuth.delete({ where: { k1 } })