is there a way to redirect back to the `/` when us...
# help
p
is there a way to redirect back to the
/
when using
supabase.auth.signOut()
i can't find it in the docs
n
Hello ! This thread has been automatically created from your message in 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.
p
I have tried
Copy code
const {error} = await supabase.auth.signOut({
      redirectTo: 'http://localhost:3000/',
    })
g
No. You should be able to redirect your page in the browser or framework router though after the await or in onAuthStateChange Signed_Out event.
n
Paul (2022-03-23)
p
how can i get them abck to the home page then once they have logged out?
g
You just tell the browser to go there.... I use sveltkit with a router and after the signout call finishes, it returns and then I user the router to change the page.
Copy code
function signOut() {
        SBsignOut()
        goto("/")
    }
You can do that directly in javascript also.
p
ok cool thanks ill take a look Gary