Skip to content

Commit

Permalink
Fix : Modify Cors value
Browse files Browse the repository at this point in the history
-# 8
  • Loading branch information
carboxaminoo committed Mar 5, 2024
1 parent c00c622 commit bde6b46
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion mz_v1_front/src/routes/join/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ async function handleSubmit(event) {
const response = await fetch('http://175.45.194.59:5050/api/v1/users', {
method: 'POST',
body: formData,
credentials: 'include',
});
if (response.ok) {
Expand Down
7 changes: 3 additions & 4 deletions mz_v1_front/src/routes/login/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
const response = await fetch("http://175.45.194.59:5050/api/v1/auth", {
method: 'POST',
body: formData,
// mode: 'no-cors',
credentials: 'include',
});
if (response.status === 200) {
if (response.ok) {
const data = await response.json(); // 백엔드로부터 받은 데이터를 JSON으로 파싱
const { token, email } = data; // 파싱된 JSON 객체에서 token과 email을 추출
Expand All @@ -39,7 +38,7 @@
alert('로그인 실패 \n 이메일과 비밀번호를 확인해주세요');
}}
catch (error) {
console.error('로그인 중 에러 발생:', error);
console.error(`로그인 실패: ${error.message}`);
alert('로그인 중 에러가 발생했습니다.');
}
}
Expand Down

0 comments on commit bde6b46

Please sign in to comment.