Initial commit
This commit is contained in:
8
app/middleware/admin_auth_middleware.js
Normal file
8
app/middleware/admin_auth_middleware.js
Normal file
@@ -0,0 +1,8 @@
|
||||
export default class AdminAuthMiddleware {
|
||||
redirectTo = '/admin/login';
|
||||
async handle(ctx, next, options = {}) {
|
||||
await ctx.auth.authenticateUsing(options.guards, { loginRoute: this.redirectTo });
|
||||
return next();
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=admin_auth_middleware.js.map
|
||||
Reference in New Issue
Block a user