mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: fix UserLoginHandler behavior when disabled builtin login (#1150)
This commit is contained in:
1 parent
3666178406
commit
d8a5716a22
1 file changed
+2
-3
@@ -45,12 +45,10 @@ async function successfulAuth(this: Handler, udoc: User) {
|
||||
|
||||
class UserLoginHandler extends Handler {
|
||||
noCheckPermView = true;
|
||||
async prepare() {
|
||||
if (!system.get('server.login')) throw new BuiltinLoginError();
|
||||
}
|
||||
|
||||
async get() {
|
||||
this.response.template = 'user_login.html';
|
||||
this.response.body.loginMethods = this.loginMethods;
|
||||
}
|
||||
|
||||
@param('uname', Types.Username)
|
||||
@@ -63,6 +61,7 @@ class UserLoginHandler extends Handler {
|
||||
domainId: string, uname: string, password: string, rememberme = false, redirect = '',
|
||||
tfa = '', authnChallenge = '',
|
||||
) {
|
||||
if (!system.get('server.login')) throw new BuiltinLoginError();
|
||||
let udoc = await user.getByEmail(domainId, uname);
|
||||
udoc ||= await user.getByUname(domainId, uname);
|
||||
if (!udoc) throw new UserNotFoundError(uname);
|
||||
|
||||
Reference in new issue
Block a user