getAuthUser becomes async.
This commit is contained in:
@ -89,7 +89,7 @@ async function initApiRouter (options: RegisterServerOptions): Promise<Router> {
|
||||
|
||||
router.get('/auth', asyncMiddleware(
|
||||
async (req: Request, res: Response, _next: NextFunction) => {
|
||||
const user = getAuthUser(options, res)
|
||||
const user = await getAuthUser(options, res)
|
||||
if (!user) {
|
||||
res.sendStatus(403)
|
||||
return
|
||||
|
@ -24,7 +24,7 @@ async function initSettingsRouter (options: RegisterServerOptions): Promise<Rout
|
||||
res.sendStatus(403)
|
||||
return
|
||||
}
|
||||
if (!isUserAdmin(options, res)) {
|
||||
if (!await isUserAdmin(options, res)) {
|
||||
res.sendStatus(403)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user