diff options
Diffstat (limited to 'server/middlewares/auth.ts')
-rw-r--r-- | server/middlewares/auth.ts | 4 |
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 | ||
50 | function authenticatePromiseIfNeeded (req: express.Request, res: express.Response, authenticateInQuery = false) { | 50 | function 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 | |||
76 | export { | 76 | export { |
77 | authenticate, | 77 | authenticate, |
78 | authenticateSocket, | 78 | authenticateSocket, |
79 | authenticatePromiseIfNeeded, | 79 | authenticatePromise, |
80 | optionalAuthenticate | 80 | optionalAuthenticate |
81 | } | 81 | } |