Skip to content

Commit

Permalink
Added cors options
Browse files Browse the repository at this point in the history
  • Loading branch information
Adityapnn811 committed Aug 3, 2022
1 parent 529c3d3 commit 645dec5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pages/login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ export default function Login(){
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': 'https://dondra.vercel.app/'
},
body: JSONdata
}

const response = await fetch(endpoint, options);
const response = await fetch(endpoint, options).catch(err => console.log(err));
const data = await response.json();
// if success, set cookies and redirect to home
if (data.success){
Expand Down
3 changes: 2 additions & 1 deletion pages/register.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export default function Login(){
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': 'https://dondra.vercel.app/'
},
body: JSONdata
}
Expand Down

1 comment on commit 645dec5

@vercel
Copy link

@vercel vercel bot commented on 645dec5 Aug 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

dondra – ./

dondra.vercel.app
dondra-git-main-adityapnn811.vercel.app
dondra-adityapnn811.vercel.app

Please sign in to comment.