summaryrefslogtreecommitdiff
path: root/src/routers/vault/types
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2020-03-11 18:14:03 -0400
committergumi <git@gumi.ca>2020-03-11 18:14:03 -0400
commit267b900a82d7870e4bcd56857887fd3f697e6e45 (patch)
treea4211a9d3e3ff8db65c582c1bc6aac5d5b15a3ab /src/routers/vault/types
parent00e707bffa2157df7772e417a5d48e66229e4013 (diff)
downloadapiv1-267b900a82d7870e4bcd56857887fd3f697e6e45.tar.gz
apiv1-267b900a82d7870e4bcd56857887fd3f697e6e45.tar.bz2
apiv1-267b900a82d7870e4bcd56857887fd3f697e6e45.tar.xz
apiv1-267b900a82d7870e4bcd56857887fd3f697e6e45.zip
refactor the authentication and validation
Diffstat (limited to 'src/routers/vault/types')
-rw-r--r--src/routers/vault/types/Session.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/routers/vault/types/Session.js b/src/routers/vault/types/Session.js
index 9f0cd95..17c77ef 100644
--- a/src/routers/vault/types/Session.js
+++ b/src/routers/vault/types/Session.js
@@ -1,3 +1,5 @@
+const uuidv4 = require("uuid/v4");
+
/**
* holds a cache of all the user data fetched from SQL
*/
@@ -12,6 +14,8 @@ module.exports = class Session {
identity = null;
/** the email address of the identity that was used to log in */
email;
+ /** the secret that is sent after authentication */
+ secret;
/** cache holding all identities */
identities = [];
/** the main identity of the account */
@@ -30,6 +34,7 @@ module.exports = class Session {
constructor (ip, email) {
this.ip = ip;
this.email = email.toLowerCase();
+ this.secret = uuidv4();
}
/**