Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when i signin then only loader is working not signin successfully please anyone help me and and another error is Property 'email' does not exist on type 'Promise<KindeUser | null>'.ts(2339) #80

Open
baghelkunalpal opened this issue Mar 15, 2024 · 5 comments

Comments

@baghelkunalpal
Copy link

image
image

@baghelkunalpal
Copy link
Author

Solve the issue AnyOne check it why this is happing when i doing the signin then every second error showed in pre picture every second occur the error check

@CheongCheeFeng
Copy link

Hi @baghelkunalpal , I'm facing the same issue too. Are you able to solve the issue?

@farnell
Copy link

farnell commented Mar 21, 2024

the later version of kinde returns a user promise so you have to add async to the function and await the user, check below

authCallback: publicProcedure.query(async () => {
    const { getUser } = getKindeServerSession();
    const user = await getUser();

    if (!user || !user.email) {
      throw new TRPCError({ code: "UNAUTHORIZED", message: "Unauthorized" });
    }
    ...

@baghelkunalpal
Copy link
Author

the later version of kinde returns a user promise so you have to add async to the function and await the user, check below

authCallback: publicProcedure.query(async () => {
    const { getUser } = getKindeServerSession();
    const user = await getUser();

    if (!user || !user.email) {
      throw new TRPCError({ code: "UNAUTHORIZED", message: "Unauthorized" });
    }
    ...

Thanks You so much its resolve..

@baghelkunalpal
Copy link
Author

Hi @baghelkunalpal , I'm facing the same issue too. Are you able to solve the issue?

the later version of kinde returns a user promise so you have to add async to the function and await the user, check below

authCallback: publicProcedure.query(async () => {
const { getUser } = getKindeServerSession();
const user = await getUser();

if (!user || !user.email) {
  throw new TRPCError({ code: "UNAUTHORIZED", message: "Unauthorized" });
}
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants