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

Test | Login Fixes #14

Merged
merged 1 commit into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pages/login/officer/forgot-password/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function ForgotPassword() {
openProcessingModal();

event.preventDefault();
const res = await fetch("https://localhost:8585/login/officer/forgot-password", {
const res = await fetch("http://localhost:8585/login/officer/forgot-password", {
body: JSON.stringify({officerId: officerNumber}),
headers: {'Content-Type': 'application/json'},
method: 'POST'
Expand Down
4 changes: 2 additions & 2 deletions pages/login/officer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ export default function OfficerLogin() {

event.preventDefault();

const res = await fetch("https://localhost:8585/login/officer", {
const loginRes = await fetch("http://localhost:8585/login/officer", {
body: JSON.stringify({officerId: officerNumber, password: password}),
headers: {'Content-Type': 'application/json'},
method: 'POST'
});
const data = await res.json();
const data = await loginRes.json();
if (data.result.loginSuccess) {
closeProcessingModal();
await router.push("/officer");
Expand Down
2 changes: 1 addition & 1 deletion pages/login/student/forgot-password/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function ForgotPassword() {
openProcessingModal();

event.preventDefault();
const res = await fetch("https://localhost:8585/login/student/forgot-password", {
const res = await fetch("http://localhost:8585/login/student/forgot-password", {
body: JSON.stringify({studentId: studentNumber}),
headers: {'Content-Type': 'application/json'},
method: 'POST'
Expand Down
4 changes: 2 additions & 2 deletions pages/login/student/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function StudentLogin() {

event.preventDefault();

const res = await fetch("https://localhost:8585/login/student", {
const loginRes = await fetch("http://localhost:8585/login/student", {
body: JSON.stringify({studentId: studentNumber, password: password}),
headers: {'Content-Type': 'application/json'},
method: 'POST'
Expand All @@ -56,7 +56,7 @@ export default function StudentLogin() {
if (loginData.result.loginSuccess) {
const cookies = new Cookies();
cookies.set('studentNumber', studentNumber, {path: '/'});
const getRes = await fetch("https://sis-be.herokuapp.com/student/" + cookies.get('studentNumber'), {
const getRes = await fetch("http://localhost:8585/student/" + cookies.get('studentNumber'), {
headers: {'Content-Type': 'application/json'},
method: 'GET'
});
Expand Down
2 changes: 1 addition & 1 deletion pages/login/teacher/forgot-password/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function ForgotPassword() {
openProcessingModal();

event.preventDefault();
const res = await fetch("https://localhost:8585/login/teacher/forgot-password", {
const res = await fetch("http://localhost:8585/login/teacher/forgot-password", {
body: JSON.stringify({teacherId: teacherNumber}),
headers: {'Content-Type': 'application/json'},
method: 'POST'
Expand Down
4 changes: 2 additions & 2 deletions pages/login/teacher/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function TeacherLogin() {

event.preventDefault();

const res = await fetch("https://localhost:8585/login/teacher", {
const loginRes = await fetch("http://localhost:8585/login/teacher", {
body: JSON.stringify({teacherId: teacherNumber, password: password}),
headers: {'Content-Type': 'application/json'},
method: 'POST'
Expand All @@ -56,7 +56,7 @@ export default function TeacherLogin() {
if (loginData.result.loginSuccess) {
const cookies = new Cookies();
cookies.set('teacherNumber', teacherNumber, {path: '/'});
const getRes = await fetch("https://sis-be.herokuapp.com/teacher/" + cookies.get('teacherNumber'), {
const getRes = await fetch("http://localhost:8585/teacher/" + cookies.get('teacherNumber'), {
headers: {'Content-Type': 'application/json'},
method: 'GET'
});
Expand Down