Skip to content

Build failing for correct field type in OAuth Provider response #11302

Answered by k-taro56
onlinejudge95 asked this question in Help
Discussion options

You must be logged in to vote

I think this will work perfectly!

async signIn({ user }) {
    if (!user?.email) {
        throw new Error('No email associated with the email profile');
    }

    await prisma.users.upsert({
        where: {
            email: user.email
        },
        create: {
            id: user.id,
            email: user.email,
            name: user.name,
            avatar: user.image,
        },
        update: {
            name: user.name,
            avatar: user.image,
        },
    });
    return true;
}

Replies: 2 comments 11 replies

Comment options

You must be logged in to vote
6 replies
@k-taro56
Comment options

@onlinejudge95
Comment options

@k-taro56
Comment options

@onlinejudge95
Comment options

@k-taro56
Comment options

Comment options

You must be logged in to vote
5 replies
@onlinejudge95
Comment options

@k-taro56
Comment options

@onlinejudge95
Comment options

@k-taro56
Comment options

Answer selected by onlinejudge95
@onlinejudge95
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants