passport-discord icon indicating copy to clipboard operation
passport-discord copied to clipboard

The Cookie is not applying to Front-end website

Open CutieCat6778 opened this issue 3 years ago • 3 comments

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
})

CutieCat6778 avatar Jun 05 '21 17:06 CutieCat6778

Did you manage to fix this @CutieCat6778? I'm having the same issue.

FC5570 avatar Sep 18 '21 14:09 FC5570

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.

CutieCat6778 avatar Sep 28 '21 18:09 CutieCat6778

ah ok. thanks @CutieCat6778

FC5570 avatar Sep 29 '21 07:09 FC5570