aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/auth.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/auth.ts')
-rw-r--r--server/middlewares/auth.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/middlewares/auth.ts b/server/middlewares/auth.ts
index c5424be97..ad3b24ab2 100644
--- a/server/middlewares/auth.ts
+++ b/server/middlewares/auth.ts
@@ -47,7 +47,7 @@ function authenticateSocket (socket: Socket, next: (err?: any) => void) {
47 .catch(err => logger.error('Cannot get access token.', { err })) 47 .catch(err => logger.error('Cannot get access token.', { err }))
48} 48}
49 49
50function authenticatePromiseIfNeeded (req: express.Request, res: express.Response, authenticateInQuery = false) { 50function authenticatePromise (req: express.Request, res: express.Response, authenticateInQuery = false) {
51 return new Promise<void>(resolve => { 51 return new Promise<void>(resolve => {
52 // Already authenticated? (or tried to) 52 // Already authenticated? (or tried to)
53 if (res.locals.oauth?.token.User) return resolve() 53 if (res.locals.oauth?.token.User) return resolve()
@@ -76,6 +76,6 @@ function optionalAuthenticate (req: express.Request, res: express.Response, next
76export { 76export {
77 authenticate, 77 authenticate,
78 authenticateSocket, 78 authenticateSocket,
79 authenticatePromiseIfNeeded, 79 authenticatePromise,
80 optionalAuthenticate 80 optionalAuthenticate
81} 81}