Skip to content

How do I edit the user object received from say Google provider BEFORE it is saved to my DB. I use MongoDB? #1348

@dankore

Description

@dankore

Your question

How do I edit the user object received from say Google provider BEFORE it is saved to my DB. I use MongoDB.

What are you trying to do

Story

  • User clicks Sign in with Google on my Next.js app using next-auth
  • Add a username property to the user object returned by Google
  • User is redirected to "/profile/${username}"
  • I check my MongoDB and find the new user's information including the property I added (i.e username field) BEFORE the user is saved to my DB.

Reproduction

NA

Feedback
Documentation refers to searching through online documentation, code comments and issue history. The example project refers to next-auth-example.

  • Found the documentation helpful
  • Found documentation but was incomplete
  • Could not find relevant documentation
  • Found the example project helpful
  • Did not find the example project helpful

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionAsk how to do something or how something works

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions