refactor: make authenticated async everywhere
Since this checks if they are authenticated using the hash/password and it's async, we need to update authenticated to be async, which means we have to update it everywhere it's used.
This commit is contained in:
@ -49,9 +49,9 @@ const limiter = new RateLimiter()
|
||||
|
||||
export const router = Router()
|
||||
|
||||
router.use((req, res, next) => {
|
||||
router.use(async (req, res, next) => {
|
||||
const to = (typeof req.query.to === "string" && req.query.to) || "/"
|
||||
if (authenticated(req)) {
|
||||
if (await authenticated(req)) {
|
||||
return redirect(req, res, to, { to: undefined })
|
||||
}
|
||||
next()
|
||||
|
Reference in New Issue
Block a user