Start building awesome apps in under 5 minutes
.env
file:auth
function. If the user is not authenticated, the function will return null
. If the user is authenticated, the function will return the verified JWT object.
Add an api route to handle the callback from the hosted accounts page. Create a new file called app/api/auth/callback.ts
. Add the following code:
app/onboard/page.tsx
. Add the following code:
app/api/protected/route.ts
. Add the following code:
auth
function. For example, if your actions are in lib/actions.ts add the following code:
getToken
function. For example:
components/user-button.tsx
. Add the following code: