Skip to content

Commit

Permalink
minor changes to google auth pop up close error
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiyanggg committed Apr 24, 2024
1 parent da300e2 commit 45e843c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
16 changes: 10 additions & 6 deletions src/components/LoginAuth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,16 @@ const loginWithGoogle = async (event) => {
}
}
} catch (error) {
loginStatus.value = "error";
message_passed = "errorLogin";
email.value = "";
password.value = "";
error.value = error.code;
showError.value = true;
if (error.code === "auth/popup-closed-by-user") {
console.log("Popup closed by user");
} else {
loginStatus.value = "error";
message_passed = "errorLogin";
email.value = "";
password.value = "";
error.value = error.code;
showError.value = true;
}
}
};
Expand Down
18 changes: 11 additions & 7 deletions src/components/RegisterAuth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,17 @@ export default {
// Set user info into firebase
await setDoc(userDocRef, userData);
} catch (error) {
console.error("Error during registration:", error);
this.registrationStatus = "error";
this.errorMessage = error.message;
this.showError = true;
this.showPopup = false;
this.message_passed = "errorRegistration";
console.log("hereeee -->", this.errorMessage, "lol");
if (error.code === "auth/popup-closed-by-user") {
console.log("Popup closed by user");
} else {
console.error("Error during registration:", error);
this.registrationStatus = "error";
this.errorMessage = error.message;
this.showError = true;
this.showPopup = false;
this.message_passed = "errorRegistration";
console.log("hereeee -->", this.errorMessage, "lol");
}
}
},
Expand Down

0 comments on commit 45e843c

Please sign in to comment.