diff options
author | gumi <git@gumi.ca> | 2020-03-28 12:43:49 -0400 |
---|---|---|
committer | gumi <git@gumi.ca> | 2020-03-28 12:43:49 -0400 |
commit | b7a6dbe4bec7e003561f94312073d704553e438f (patch) | |
tree | 07eda7556625aaf7e0e1db4db5b640d221fcb216 /src/routers/vault/middlewares | |
parent | d83e4cb9a5d12230a1d255dcd2c9f167c5cc4751 (diff) | |
download | api-b7a6dbe4bec7e003561f94312073d704553e438f.tar.gz api-b7a6dbe4bec7e003561f94312073d704553e438f.tar.bz2 api-b7a6dbe4bec7e003561f94312073d704553e438f.tar.xz api-b7a6dbe4bec7e003561f94312073d704553e438f.zip |
add authentication bypass for local development
Diffstat (limited to 'src/routers/vault/middlewares')
-rw-r--r-- | src/routers/vault/middlewares/session.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/routers/vault/middlewares/session.js b/src/routers/vault/middlewares/session.js index 454a235..1c322e4 100644 --- a/src/routers/vault/middlewares/session.js +++ b/src/routers/vault/middlewares/session.js @@ -358,7 +358,16 @@ const new_session = async (req, res, next) => { console.log(`Vault.session: starting authentication with identity ${identity.id} [${req.ip}]`); if (process.env.NODE_ENV === "development") { - console.log(`uuid: ${uuid}`); + if (process.env.VAULT__BYPASS_LOGIN === "bypass") { + // don't require copy-pasting the uuid + res.status(200).json({ + status: "success", + key: uuid, + }); + } else { + console.log(`uuid: ${uuid}`); + } + return; } else { transporter.sendMail({ from: process.env.VAULT__MAILER__FROM, |