Yes it looks good. If you dont mind some unsolicited advice 😅, you may want to consider the renaming of the function to reflect it's concern of updating tokens only. Using the FindOneAndUpdate method is good but since the fucntion is supposed to only make an update you may resort to another function returning the user object or naming the function accordingly. This is mostly for readability and clean code purposes
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In my implementation I had used FindOneAndUpdate method github.com/shreyngd/booker/blob/26....
This method returns the updated user. I don't know whether it is correct way.
Yes it looks good. If you dont mind some unsolicited advice 😅, you may want to consider the renaming of the function to reflect it's concern of updating tokens only. Using the FindOneAndUpdate method is good but since the fucntion is supposed to only make an update you may resort to another function returning the user object or naming the function accordingly. This is mostly for readability and clean code purposes