<passage-auth>
element into your component that will handle login. This is done in the example in frontend/src/views/Home.js:@passageidentity/passage-elements/passage-user
. This example wraps this functionality into a reusable react hook in useAuthStatus:PassageUser().authGuard()
function can be used as a route guard in your application, but it should NOT be make authorization decisions when fetching data from an API server. Route guards provide a better user experience, but less security than using one of Passage's backend libraries. For applications using an API server, you must use one of the Passage backend SDKs to safely verify user authentication tokens.useEffect()
. An example is shown below.