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

Cross Origin #1

Open
Gismo1337 opened this issue May 29, 2021 · 2 comments
Open

Cross Origin #1

Gismo1337 opened this issue May 29, 2021 · 2 comments

Comments

@Gismo1337
Copy link

Should implement headers: { 'Access-Control-Allow-Origin': '*' } for devServer at Port 8080 to sign up and login.
Would be useful for beginners.

@cyril-tl
Copy link

cyril-tl commented Jul 22, 2021

@Gismo1337 should I add it like this ?

// auth-header.js
`export default function authHeader() {
let user = JSON.parse(localStorage.getItem('user'));

if (user && user.accessToken) {
return { 'Access-Control-Allow-Origin': '*', Authorization: 'Bearer ' + user.accessToken };
} else {
return {};
}
}
`

@SkyDonald
Copy link

CORS should be handled server-side

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

3 participants