ThirdPartyEmailPassword Auth wrapper
The ThirdPartyEmailPasswordAuth
component is used to wrap any component that requires authentication in an application.
Example:
import SuperTokens from "supertokens-auth-react";
import {ThirdPartyEmailPasswordAuth} from "supertokens-auth-react/recipe/thirdpartyemailpassword";
class App extends React.Components {
render() {
return (
<ThirdPartyEmailPasswordAuth>
<Dashboard />
</ThirdPartyEmailPasswordAuth>
);
}
}
ThirdPartyEmailPasswordAuth
takes a prop calledrequireAuth
which if set tofalse
, will show theDashboard
component even if the user is not logged in.ThirdPartyEmailPasswordAuth
also creates a "Session context" which provides the following object to all children components:{ doesSessionExist: boolean, userId: string, jwtPayload: any /*JSON object set on the backend*/ }