Closed Tilican closed 4 years ago
What do you mean by
Everything is OK, i can login, everything is in database but i never got a session
Is there an error message that you are getting during the process, or when you are trying to do something afterward?
@YasharF no error, but i connect, i got redirected to '/' and i'm not connected, i can't manage my account etc ...
I got every data on mongoDb, email, twitch picture etc ... But i can't connect it's weird
But if i do it with email/ password on another account it works !
I don't understand what you mean by
i can't connect
Gif will explain @YasharF
When i login with local
When i login with twitch ( i already accept oauth connection )
Database
i got it ...
in app.js
/**
* OAuth authorization routes. (API examples)
*/
app.get('/auth/twitch', passport.authorize('twitch', {}));
app.get('/auth/twitch/callback', passport.authorize('twitch', { failureRedirect: '/login' }), (req, res) => {
res.redirect(req.session.returnTo);
});
should be
/**
* OAuth authorization routes. (API examples)
*/
app.get('/auth/twitch', passport.authenticate('twitch', {}));
app.get('/auth/twitch/callback', passport.authenticate('twitch', { failureRedirect: '/login' }), (req, res) => {
res.redirect(req.session.returnTo || '/');
});
In case if you are still working on this, I added twitch support with https://github.com/sahat/hackathon-starter/commit/c8df1150075b6e32129a9974975529e2e7a2dc37 and https://github.com/sahat/hackathon-starter/commit/901140f3b8949ea79029bab1cf1bf706e8ef2a7c
Hi, I want to create a Twitch login but i can't make it works ...
This is my custom oauth for twitch
I import this custom oauth and create a passport strategy with in passport.js
I add some links in app.js
I add this in login.pug
Everything is OK, i can login, everything is in database but i never got a session ! If i create an account with email it works correctly ...
What i have missed ?