Thanks for your comments Josue! Not sure what the error was. I cannot really understand it from the code that you shared. It's indeed strange that the console.log says User is undefined but the next line User.findOne works. If you still have a problem would you mind sharing the code in a codesandbox? Would be much easier to debug ;-)
Thanks for your comments Josue! Not sure what the error was. I cannot really understand it from the code that you shared. It's indeed strange that the console.log says User is undefined but the next line User.findOne works. If you still have a problem would you mind sharing the code in a codesandbox? Would be much easier to debug ;-)
Oh, thanks for the offer... in fact for the same reason, the register doesn´t work ( i will be working on that the next 3 hours).
You can check the public repo here:
github
and the passport config
I am getting confused with the async function .save() from mongoose and the async login/logout with passport
you can check it in the user resolver
So far is working...
I have an other questions...
¿How do you know that the user is logged?. Can I check that in a resolver? where is that? in the context?.
With passport session, we had a collection for all those sessions and had access with something like this:
a simpel middleware.
Can I check for my user if is authenticated??
something like this:
context.req.isAuthenticated()
Yeap, it works, but it restart after changing anything (nodemon).
Btw, checking the context.req object we have something:
Can I store this in a database, like passport use to do with
passport.session()