Next.js Discord

Discord Forum

Next-auth credentials provider

Unanswered
Vaikruta posted this in #help-forum
Open in Discord
So I'm trying to include both credentials provider and google Provider. I'm kind of stuck trying to access the image and don't know if I'm doing it correctly. If the user logs in through credentials provider then I want the image(stored in database) property to be stored inside the profilePic property as shown in the code. But if the user logs in through google, then i want google pic to be selected. The model user in prisma has image property for the profilePic. I want the image to be availble in the session so that i can easily display it instead of doing additional database query.

Is my approach right, or am I doing something wrong?
The screenshot of the code is attached.
Please help!

0 Replies