https://supertokens.com/ logo
a

Artyom

06/09/2022, 4:46 PM
Can I wrap my whole React app in
<ThirdPartyEmailPasswordAuth> ... </ThirdPartyEmailPasswordAuth>
while still requiring auth in some place and not others?
r

rp

06/09/2022, 4:46 PM
Hey @Artyom
a

Artyom

06/09/2022, 4:47 PM
My usecase is that I want to access session info in a bunch of places, but when I wrap a component in
<ThirdPartyEmailPasswordAuth> ... </ThirdPartyEmailPasswordAuth>
, it almost always means I have to create a sub-component and it adds boilerplate
r

rp

06/09/2022, 4:47 PM
We plan on making this possible. But for now, it’s not advisable cause if you use wrap even our pre built UI around this, it will cause an infinite loop when visiting the email verification screen.
a

Artyom

06/09/2022, 4:48 PM
Ok noted
r

rp

06/09/2022, 4:48 PM
But if you do not wrap our pre built around this, you can wrap all the other routes with it and provide the requireAuth=false prop to it.
And then routes that do require auth cause use this wrapper again without the requireAuth prop and it will all work
a

Artyom

06/09/2022, 4:49 PM
Aha, okay, good to know
Thanks
r

rp

06/09/2022, 4:50 PM
Finally, the other limitation this has now is that it won’t work with server side rendering. Again, we are working on solving that too.
a

Artyom

06/09/2022, 4:51 PM
Is there a GH issue I can subscribe to re/ wrapping the whole app?
a

Artyom

06/09/2022, 4:54 PM
Thanks, subscribed!