-
-
Save MonteLogic/03515da82060e578597a38872545dc55 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use server'; | |
| import { auth } from '@clerk/nextjs/server'; | |
| export default async function Page() { | |
| const { userId, sessionClaims } = auth(); | |
| // Cast sessionClaims to the correct type | |
| const typedSessionClaimsEmail = sessionClaims.userEmail as string | null; | |
| console.log(5, typedSessionClaimsEmail); | |
| // Use optional chaining and nullish coalescing for type safety | |
| return ( | |
| <div className="relative z-0 space-y-10 text-white"> | |
| <div className="space-y-5"> | |
| <h2>Onboarding</h2> | |
| Your email: {typedSessionClaimsEmail} | |
| </div> | |
| </div> | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment