aboutsummaryrefslogtreecommitdiff
path: root/client/js/util
diff options
context:
space:
mode:
authorReAnzu2018-02-25 04:44:02 -0600
committerrr-2018-03-25 22:23:29 +0200
commit2a69f0193f9e5aa451e0dbcb8c89070f3e49ffa5 (patch)
treebda640614ae711e8fef0e0463f118f85ef83ac0e /client/js/util
parente35e70992736340bff3995ca6f425baf2f431e2f (diff)
server/auth: add token authentication
* Users are only authenticated against their password on login, and to retrieve a token * Passwords are wiped from the GUI frontend and cookies after login and token retrieval * Tokens are revoked at the end of the session/logout * If the user chooses the "remember me" option, the token is stored in the cookie * Tokens correctly delete themselves on logout * Tokens can expire at user-specified date * Tokens have their last usage time * Tokens can have user defined descriptions * Users can manage login tokens in their account settings
Diffstat (limited to 'client/js/util')
-rw-r--r--client/js/util/polyfill.js7
-rw-r--r--client/js/util/views.js6
2 files changed, 13 insertions, 0 deletions
diff --git a/client/js/util/polyfill.js b/client/js/util/polyfill.js
index 91186b2..71ee972 100644
--- a/client/js/util/polyfill.js
+++ b/client/js/util/polyfill.js
@@ -59,3 +59,10 @@ Number.prototype.between = function(a, b, inclusive) {
// non standard
Promise.prototype.abort = () => {};
+
+// non standard
+Date.prototype.addDays = function(days) {
+ let dat = new Date(this.valueOf());
+ dat.setDate(dat.getDate() + days);
+ return dat;
+};
diff --git a/client/js/util/views.js b/client/js/util/views.js
index b0b7cce..9f238b1 100644
--- a/client/js/util/views.js
+++ b/client/js/util/views.js
@@ -168,6 +168,11 @@ function makeNumericInput(options) {
return makeInput(options);
}
+function makeDateInput(options) {
+ options.type = 'date';
+ return makeInput(options)
+}
+
function getPostUrl(id, parameters) {
return uri.formatClientLink(
'post', id,
@@ -392,6 +397,7 @@ function getTemplate(templatePath) {
makePasswordInput: makePasswordInput,
makeEmailInput: makeEmailInput,
makeColorInput: makeColorInput,
+ makeDateInput: makeDateInput,
makePostLink: makePostLink,
makeTagLink: makeTagLink,
makeUserLink: makeUserLink,

© 2015 - 2026 Jakob L. Kreuze