Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Cookie is not applying to Front-end website #39

Open
CutieCat6778 opened this issue Jun 5, 2021 · 3 comments
Open

The Cookie is not applying to Front-end website #39

CutieCat6778 opened this issue Jun 5, 2021 · 3 comments

Comments

@CutieCat6778
Copy link

I have 2 applications,
1 is for backend application and another is for front-end

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
})
@FC5570
Copy link

FC5570 commented Sep 18, 2021

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

@CutieCat6778
Copy link
Author

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.

@FC5570
Copy link

FC5570 commented Sep 29, 2021

ah ok. thanks @CutieCat6778

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants