Hey, guys. Does anyone have any workaround for the...
# help
b
Hey, guys. Does anyone have any workaround for the issue 'remember me' checkbox while logging in ? Changing the persistSession after creating the supabase client? https://github.com/supabase/auth-elements/issues/7#issue-1110854102
n
Hello @Brian_090! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
c
yes, there is a workaround - the persistSession field on the supabase.auth object is actually accessible so you can reset it even after you've initialized the supabase client
n
Brian_090 (2022-04-08)
c
If you are using TypeScript you would need to cast like this:
Copy code
supabase = createClient();
(supabase.auth as any).persistSession = true/false;
The reason why this is works is because the persistSession field is marked as "protected" in the original TypeScript source code. If the Supabase team decide to make it private in the future, I expect this to break, just keep that in mind