1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-14 00:46:38 -05:00

rename auth to requireAuth

This commit is contained in:
Jack Foltz 2018-08-01 17:26:02 -04:00
parent bc499aa260
commit 0ab946031e
Signed by: foltik
GPG Key ID: 303F88F996E95541

View File

@ -36,7 +36,7 @@ const checkKey = async (req, scope, status) => {
// Middleware that checks for authentication by either API key or session // Middleware that checks for authentication by either API key or session
// sets req.username, req.displayname, req.scope, and req.key if authenticated properly, // sets req.username, req.displayname, req.scope, and req.key if authenticated properly,
// otherwise throws an error code // otherwise throws an error code
const auth = scope => const requireAuth = scope =>
wrap(async (req, res, next) => { wrap(async (req, res, next) => {
const status = { const status = {
authenticated: false, authenticated: false,
@ -59,4 +59,4 @@ const auth = scope =>
module.exports.checkSession = checkSession; module.exports.checkSession = checkSession;
module.exports.checkKey = checkKey; module.exports.checkKey = checkKey;
module.exports.requireAuth = auth; module.exports.requireAuth = requireAuth;