passport-discord
passport-discord copied to clipboard
The Cookie is not applying to Front-end website
I have 2 applications, 1 is for backend application and another is for front-end
- https://noobteam.ga *
so when I run those 2 applications on local the cookies seem very normal and no problem with running. But when I deploy it to Production, the cookie on the front-end application didn't show up! But the backend one is still normal. So my question is where did I made a mistake? Because on the Local runs very normal
const router = require('express').Router();
const passport = require('passport');
router.get('/discord', passport.authenticate('discord'));
router.get('/discord/redirect', passport.authenticate('discord', { failureRedirect: '/api/auth/' }), (req, res, next) => {
res.redirect(process.env.URL); //https://noobteam.ga
})
Did you manage to fix this @CutieCat6778? I'm having the same issue.
Did you manage to fix this @CutieCat6778? I'm having the same issue.
Hey! Well I fixed it, because my back-end domain and front-end domain is kinda complicated. My old url was somedomainforbackend.com
and somedomainforfrontend.com
to dev.domain.com
and domain.com
, so the passport can apply cookies. Btw you have to change at the cors too. The cross something.... Sorry, I don't remember.
ah ok. thanks @CutieCat6778