summaryrefslogtreecommitdiffstats
path: root/webapp/src/main.js
diff options
context:
space:
mode:
authorJannik Schönartz2019-02-24 03:16:04 +0100
committerJannik Schönartz2019-02-24 03:16:04 +0100
commitceb166a81c74ca41b7d9099fb5a067c5cfc1827d (patch)
tree8283f2110a0d74ea37c5856ae3fc683cf52b9fdf /webapp/src/main.js
parent[webapp/groups] rework old tables to new data table (diff)
downloadbas-ceb166a81c74ca41b7d9099fb5a067c5cfc1827d.tar.gz
bas-ceb166a81c74ca41b7d9099fb5a067c5cfc1827d.tar.xz
bas-ceb166a81c74ca41b7d9099fb5a067c5cfc1827d.zip
[account] Add editable user info, change statuscodes, delete account
[server] Add method for updating user info Add method for deleteing user Switch from statuscode 500 to 401 Fixed stauts null exception Validate Email now allows empty email [webapp/AccountPage] Add button to delete the user account (including a dialog) Some order fixes with the info fields User info is now editable
Diffstat (limited to 'webapp/src/main.js')
-rw-r--r--webapp/src/main.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/webapp/src/main.js b/webapp/src/main.js
index 6ed1d53..2665c0a 100644
--- a/webapp/src/main.js
+++ b/webapp/src/main.js
@@ -117,6 +117,16 @@ Vue.prototype.$loop = function (count, chunksize, iteration, callback = () => {}
return loop
}
+// Function for validating an email address.
+Vue.prototype.$validateEmail = email => {
+ // TODO: Remove if email is not optional
+ if (email === '') return true
+
+ // Removed escape before [ because eslint told me so.
+ var re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
+ return re.test(String(email).toLowerCase())
+}
+
new Vue({
store,
router,