From ed9d8c3e89656c1ac152ecedb4ca0dc523071a1a Mon Sep 17 00:00:00 2001 From: thorwebdev Date: Wed, 9 Mar 2022 10:31:34 +0800 Subject: [PATCH 1/2] chore: keep user logged in. --- pages/api/auth/[...supabase].ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/api/auth/[...supabase].ts b/pages/api/auth/[...supabase].ts index faa524262..2c03c57e5 100644 --- a/pages/api/auth/[...supabase].ts +++ b/pages/api/auth/[...supabase].ts @@ -1,3 +1,6 @@ import { handleAuth } from '@supabase/supabase-auth-helpers/nextjs'; -export default handleAuth({ logout: { returnTo: '/signin' } }); +export default handleAuth({ + logout: { returnTo: '/signin' }, + cookieOptions: { lifetime: 1 * 365 * 24 * 60 * 60 } // Keep the user logged in for a year. +}); From f7ca20be49388a918d0852484a7937af98b9bace Mon Sep 17 00:00:00 2001 From: thorwebdev Date: Wed, 9 Mar 2022 11:44:26 +0800 Subject: [PATCH 2/2] chore: update supabase-auth-helpers. --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 85828fec2..8de8d4f61 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@stripe/stripe-js": "1.22.0", - "@supabase/supabase-auth-helpers": "^1.2.0", + "@supabase/supabase-auth-helpers": "^1.2.1", "classnames": "2.3.1", "next": "^12.0.9", "react": "17.0.2", diff --git a/yarn.lock b/yarn.lock index b55d5ef14..476efd040 100644 --- a/yarn.lock +++ b/yarn.lock @@ -138,10 +138,10 @@ dependencies: cross-fetch "^3.1.0" -"@supabase/supabase-auth-helpers@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@supabase/supabase-auth-helpers/-/supabase-auth-helpers-1.2.0.tgz#fb92fcee30001a03b0d222ed3035448747facd8d" - integrity sha512-k7l4bkHLOyNgLNLW+zdn+iWvvYy65S9XIIZktAw+zIoxJr182jV4LO5/bVb0Zs3AFqDkPLSq9PoTJaRwoTV7hw== +"@supabase/supabase-auth-helpers@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@supabase/supabase-auth-helpers/-/supabase-auth-helpers-1.2.1.tgz#974fae06c5d19c22d5dedd9743cef6194cbde3a8" + integrity sha512-WZF1tMRmHM3ZEYaPM3Alaa5im73XV6Y+S23yTsm0s6HW15p1dNkPpB3H1cUNy9NOCMLfzc4TC6/MSpP0+vk6Ow== dependencies: "@supabase/supabase-js" "^1.30.0" "@supabase/ui" "^0.36.3"