Session Auth wrapper
The SessionAuth
component is used to wrap any component that requires the session context.
Example:
import SuperTokens from "supertokens-auth-react";
class App extends React.Components {
render() {
return (
<SessionAuth>
<Dashboard />
</SessionAuth>
);
}
}
SessionAuth
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*/ }