diff --git a/class_registration_app/src/components/LoginPage.vue b/class_registration_app/src/components/LoginPage.vue index c5c689f..a2ab6bf 100644 --- a/class_registration_app/src/components/LoginPage.vue +++ b/class_registration_app/src/components/LoginPage.vue @@ -6,9 +6,8 @@
- - - + +
Back @@ -34,24 +33,19 @@ const tryLogin = async () => { // Enter query parameters here }, }); - console.log(response.data); const res = response.data; + const authenticationValid = (res.statusCode === 200); - if (authenticationSucceeds(res)) { - await router.push({path: '/dashboard'}); - } else { - authenticationFailed = true; + if (authenticationValid === true) { + router.push({path: './dashboard'}); } } catch (error) { console.error(error); - authenticationFailed = true; + const authenticationValid = false; } }; -const authenticationSucceeds = (response) => { - return response.data && response.data.statusCode === 200; -};