在环境文件中增加谷歌验证器开关

This commit is contained in:
2026-07-21 15:15:11 +08:00
parent e40de47b8b
commit a0056ff15b
11 changed files with 51 additions and 2 deletions

View File

@@ -231,6 +231,10 @@ class Admin extends Backend
$response = $this->initializeBackend($request);
if ($response !== null) return $response;
if (!\app\common\library\AdminTotp::isEnabled()) {
return $this->error(__('Google Authenticator is disabled'));
}
if ($request->method() !== 'POST') {
return $this->error(__('Method not allowed'), [], 0, ['statusCode' => 405]);
}