mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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 {
|
class UserLoginHandler extends Handler {
|
||||||
noCheckPermView = true;
|
noCheckPermView = true;
|
||||||
async prepare() {
|
|
||||||
if (!system.get('server.login')) throw new BuiltinLoginError();
|
|
||||||
}
|
|
||||||
|
|
||||||
async get() {
|
async get() {
|
||||||
this.response.template = 'user_login.html';
|
this.response.template = 'user_login.html';
|
||||||
|
this.response.body.loginMethods = this.loginMethods;
|
||||||
}
|
}
|
||||||
|
|
||||||
@param('uname', Types.Username)
|
@param('uname', Types.Username)
|
||||||
@@ -63,6 +61,7 @@ class UserLoginHandler extends Handler {
|
|||||||
domainId: string, uname: string, password: string, rememberme = false, redirect = '',
|
domainId: string, uname: string, password: string, rememberme = false, redirect = '',
|
||||||
tfa = '', authnChallenge = '',
|
tfa = '', authnChallenge = '',
|
||||||
) {
|
) {
|
||||||
|
if (!system.get('server.login')) throw new BuiltinLoginError();
|
||||||
let udoc = await user.getByEmail(domainId, uname);
|
let udoc = await user.getByEmail(domainId, uname);
|
||||||
udoc ||= await user.getByUname(domainId, uname);
|
udoc ||= await user.getByUname(domainId, uname);
|
||||||
if (!udoc) throw new UserNotFoundError(uname);
|
if (!udoc) throw new UserNotFoundError(uname);
|
||||||
|
|||||||
Reference in new issue
Block a user