diff --git a/functions/index.js b/functions/index.js
index 1e7e4db..2f11229 100644
--- a/functions/index.js
+++ b/functions/index.js
@@ -42,6 +42,7 @@ exports.postStationData = functions.https.onRequest((request, response) => {
// helper function to write to the database
function batchWriteDB(request, response, db, jsonData, dartCodes, stationTypeCode) {
+ if (!jsonData) return
response.set('Access-Control-Allow-Origin', '*');
response.set('Access-Control-Allow-Credentials', 'true');
@@ -136,6 +137,7 @@ exports.postLiveTrainData = functions.https.onRequest((request, response) => {
// helper function to write to the database
function batchWriteDB(request, response, db, jsonData, trainTypeCode) {
+ if (!jsonData) return
response.set('Access-Control-Allow-Origin', '*');
response.set('Access-Control-Allow-Credentials', 'true');
diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue
index 3d47421..a710f33 100644
--- a/src/components/Navbar.vue
+++ b/src/components/Navbar.vue
@@ -17,12 +17,12 @@
Your Email: {{ displayEmail }}
+ +Enter your current password to edit account settings
+ + +Missing credentials to complete this action
+{{ FirebaseSuccessMsg }}
+{{ FirebaseError }}
+ + + + + \ No newline at end of file diff --git a/src/pages/LoginPage.vue b/src/pages/LoginPage.vue index 57c0914..99dfd58 100644 --- a/src/pages/LoginPage.vue +++ b/src/pages/LoginPage.vue @@ -11,6 +11,7 @@{{ FirebaseError }}
@@ -25,7 +26,9 @@ export default { data() { return { email: "", - password: "" + password: "", + displayFirebaseError: false, + FirebaseError: "" } }, @@ -35,17 +38,16 @@ export default { methods: { login() { + this.displayFirebaseError = false const auth = getAuth(app) signInWithEmailAndPassword(auth, this.email, this.password) .then((userCredential) => { const user = userCredential.user - this.$router.push({path:'/secure'}) + this.$router.push({path:'/account'}) }) .catch((error) => { - const errorCode = error.code - const errorMessage = error.message - console.log(errorCode) - console.log(errorMessage) + this.FirebaseError = error.message + this.displayFirebaseError = true }) } } diff --git a/src/pages/SecurePage.vue b/src/pages/SecurePage.vue deleted file mode 100644 index a722258..0000000 --- a/src/pages/SecurePage.vue +++ /dev/null @@ -1,32 +0,0 @@ - -{{ FirebaseError }}
@@ -25,7 +26,9 @@ export default { data() { return { email: "", - password: "" + password: "", + displayFirebaseError: false, + FirebaseError: "" } }, @@ -35,17 +38,16 @@ export default { methods: { signup() { + this.displayFirebaseError = false; const auth = getAuth(app) createUserWithEmailAndPassword(auth, this.email, this.password) .then((userCredential) => { const user = userCredential.user - this.$router.push({path:'/secure'}) + this.$router.push({path:'/account'}) }) .catch((error) => { - const errorCode = error.code - const errorMessage = error.message - console.log(errorCode) - console.log(errorMessage) + this.FirebaseError = error.message + this.displayFirebaseError = true }) } } @@ -54,13 +56,13 @@ export default {