diff options
author | gumi <git@gumi.ca> | 2020-03-11 18:14:03 -0400 |
---|---|---|
committer | gumi <git@gumi.ca> | 2020-03-11 18:14:03 -0400 |
commit | 267b900a82d7870e4bcd56857887fd3f697e6e45 (patch) | |
tree | a4211a9d3e3ff8db65c582c1bc6aac5d5b15a3ab /src/routers/vault/types/Session.js | |
parent | 00e707bffa2157df7772e417a5d48e66229e4013 (diff) | |
download | api-267b900a82d7870e4bcd56857887fd3f697e6e45.tar.gz api-267b900a82d7870e4bcd56857887fd3f697e6e45.tar.bz2 api-267b900a82d7870e4bcd56857887fd3f697e6e45.tar.xz api-267b900a82d7870e4bcd56857887fd3f697e6e45.zip |
refactor the authentication and validation
Diffstat (limited to 'src/routers/vault/types/Session.js')
-rw-r--r-- | src/routers/vault/types/Session.js | 5 |
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(); } /** |