diff --git a/frontend/package.json b/frontend/package.json index dced95c..7c61e00 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -19,6 +19,7 @@ "echarts": "^5.5.1", "graphql": "^16.9.0", "graphql-tag": "^2.12.6", + "jwt-decode": "^4.0.0", "pdfjs-dist": "^4.3.136", "pinia": "^2.1.6", "vue": "^3.3.4", @@ -41,4 +42,4 @@ "vite-plugin-svg-icons": "^2.0.1", "webpack": "^5.88.2" } -} +} \ No newline at end of file diff --git a/frontend/src/pages/guest/SigninWithEmailAndPassword.vue b/frontend/src/pages/guest/SigninWithEmailAndPassword.vue index 33e4932..17a02ab 100644 --- a/frontend/src/pages/guest/SigninWithEmailAndPassword.vue +++ b/frontend/src/pages/guest/SigninWithEmailAndPassword.vue @@ -78,6 +78,14 @@ export default { UserAuthApi.signinByEmail(this.email, this.password) .then((response) => { + // Extract the necessary data from the response + const { access_token, refresh_token, expires_in } = response.data; + + // Save tokens and expiration time in localStorage + localStorage.setItem('access_token', access_token); + localStorage.setItem('refresh_token', refresh_token); + localStorage.setItem('expires_in', expires_in); + let signinAction = response.data.signin_result switch (signinAction) { case signinActionEnum.EXISTING_USER_PASSWORD_REQUIRED: diff --git a/frontend/src/pages/user/requests/Home.vue b/frontend/src/pages/user/requests/Home.vue index 7c6cbc1..a4cd044 100644 --- a/frontend/src/pages/user/requests/Home.vue +++ b/frontend/src/pages/user/requests/Home.vue @@ -1,20 +1,39 @@