mirror of
https://github.com/whyour/qinglong.git
synced 2026-06-30 20:35:09 +08:00
添加两步验证
This commit is contained in:
@@ -18,7 +18,12 @@ export default ({ app }: { app: Application }) => {
|
||||
app.use(bodyParser.urlencoded({ limit: '50mb', extended: true }));
|
||||
app.use(
|
||||
jwt({ secret: config.secret as string, algorithms: ['HS384'] }).unless({
|
||||
path: ['/api/login', '/api/crons/status', /^\/open\//],
|
||||
path: [
|
||||
'/api/login',
|
||||
'/api/crons/status',
|
||||
/^\/open\//,
|
||||
'/api/user/two-factor/login',
|
||||
],
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -52,7 +57,9 @@ export default ({ app }: { app: Application }) => {
|
||||
if (
|
||||
!headerToken &&
|
||||
req.path &&
|
||||
(req.path === '/api/login' || req.path === '/open/auth/token')
|
||||
(req.path === '/api/login' ||
|
||||
req.path === '/open/auth/token' ||
|
||||
req.path === '/api/user/two-factor/login')
|
||||
) {
|
||||
return next();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user