Hello! How can I create a React component that sh...
# general
f
Hello! How can I create a React component that shows a Login or Logout button ?
r
Hey! You mean from a style point of view or functionality?
f
functionality
r
Which supertokens recipe are you using?
f
thirdpartyemailpassword
useSessionContext
seems to require
ThirdPartyEmailPasswordAuth
which always redirect the user
The auth wrapper component will redirect only if a session doesn’t exist
f
how can I know if the current visitor is logged or not?
r
You can pass requireAuth={false} prop to the auth wrapper
f
ahhh
great
r
And then inside your component, use useSessionContext to check if a session exists or not
f
perfect, that was the missing piece
it worked
thanks!
r
awesome :))
2 Views