From fa47b595a5644b7295c0d52b7e7be1f50313a903 Mon Sep 17 00:00:00 2001 From: nic21003 Date: Mon, 6 Nov 2023 15:49:19 -0500 Subject: [PATCH] login routing change --- .../src/components/LoginPage.vue | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/class_registration_app/src/components/LoginPage.vue b/class_registration_app/src/components/LoginPage.vue index f7f3d1f..22cc2b2 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; -};