Thursday 31 October 2019

[Help] The best strategy to check for users in passportjs async workflow

I am new to node development and authentication with oauth. I'm using passportjs with a oauth strategy in a express app. I need to check if the user exists in my API (decoupled from the backend) so my initial thought was check for users in the passport strategy callback with an API call, but I have learnt that await and a callback cannot be used at the same time.Later I thought about transferring that responsibility to the frontend (React). I mean, return the opendid details to the frontend and do checking in the API (GET user, if not user POST user).Is that a good or recommendable approach?

Submitted October 31, 2019 at 12:18PM by pmontp19

No comments:

Post a Comment