Closed mrhanson3 closed 3 years ago
@mrhanson3 It does not mean something is wrong necessarily. If your user is logged-out then req.user
can be undefined
or null
(depending on definition) on API
server.
When your user is logged-in, passport
or passwordless
populate req.user
with corresponding user object (created from corresponding MongoDB document).
But when I go to sign in through Google auth I get Forbidden on this page: http://localhost:8000/auth/google.
@mrhanson3 Most likely reason is that you did not mount Express routes for Google OAuth in your Express server. Please provide link to the codebase that has this problem. Whenever there is a bug, please share code since I can't help without seeing it.
The codebase is copied from your code base. The only thing that isn't online are the envs. https://github.com/mrhanson3/saas-master6
@mrhanson3 I took your codebase, installed packages and added my environmental variables. Google signup and login worked for me. It means the problem is with either the way you configured Google OAuth app at Google Cloud Platform and/or environmental variables.
This is embarrassing. It was an issue with my cut and paste job to my client ID. Sorry for bothering you with it.
I keep getting this in the terminal that runs api. There are no issues in the app terminal. The code is the same code as the root folder here, I just added my own .env to api and app. Any thoughts about what I'm doing wrong?