Skip to content

Commit

Permalink
Merge branch 'main' of github.com:tobyyu007/Res-a-Me into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliot0122 committed Dec 6, 2023
2 parents 0aa705c + 32adec6 commit ae89605
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions frontend/src/vue/core/LoginView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,34 @@ export default {
credentials: 'include'
})
.then((response) => response.json())
.then((json) => {
.then(async (json) => {
if (json.status === 200) {
console.log("Login successful")
console.log(json)
sessionStorage.setItem("access_token", json['access_token']);
sessionStorage.setItem("refresh_token", json['refresh_token']);
this.$router.push('/home');
try {
const updateResponse = await fetch("http://127.0.0.1:3033/updateResume", {
method: "POST",
headers: {
"Content-type": "application/json; charset=UTF-8",
},
body: JSON.stringify({
email: this.email,
}),
});
const json = await updateResponse.json();
if (json.status !== 200) {
console.error("Error fetching user resume: ", json.message);
}
this.$router.push({
path: "/home"
})
.then(() => window.location.reload(true))
}
catch (error){
console.error("Error fetching user resume: ", error);
}
}
else {
this.errorMessage = "Login failed. Please try again.";
Expand Down

0 comments on commit ae89605

Please sign in to comment.