Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
By debugging I found out that the AuthGuard doesn't call Passport's logIn()-function and therefore the user is only set to the request, but not persisted to the session. I believe this is quite an unexpected behavior for most users because it is different to the default way that Passport works.
In my opinion this should either be fixed or at least documented.
I'm confused by the Inheritance section you refer to, @kamilmysliwiec.
In that section, you have a code comment that reads:
As well, there's a sample app for this section (https://github.com/nestjs/nest/tree/master/sample/19-auth/src) which has a
Assuming that the
Finally, I imported it as a provider in the .module.ts file, and then, in my controller, replaced the
...Although I'm getting issues in my Google strategy now, so we'll see what's up there... It's running my Strategy's
Edit: Whoops; I realized it wasn't crashing, just throwing a console.log because serializeUser didn't have a User yet.
Anyway, I successfully got the Google OAuth2 page, clicked it and got a profile back (which I've been able to do since yesterday), but it's still not an active session. When I go back to a page that requires auth, it still has no user in