Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf2b7d10

Browse files
Thomasrludomikula
Thomasr
authored andcommitted
Allow super admin to login even when email login is disabled
1 parent5a9732c commitf2b7d10

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

‎server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/authentication/service/AuthenticationApiServiceImpl.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,23 @@ protected Mono<AuthUser> authenticate(String authId, @Deprecated String source,
9898
})
9999
.flatMap(findAuthConfig -> {
100100
context.setAuthConfig(findAuthConfig.authConfig());
101+
// Check if email/password is superadmin before checking EMAIL provider enable
101102
if (findAuthConfig.authConfig().getSource().equals("EMAIL")) {
102-
if(StringUtils.isBlank(context.getOrgId())) {
103+
if(StringUtils.isBlank(context.getOrgId())) {
103104
context.setOrgId(Optional.ofNullable(findAuthConfig.organization()).map(Organization::getId).orElse(null));
104105
}
106+
// --- Superadmin check start ---
107+
if (contextinstanceofFormAuthRequestContextformContext) {
108+
Stringemail =formContext.getLoginId();
109+
Stringpassword =formContext.getPassword();
110+
StringsuperAdminEmail =commonConfig.getSuperAdmin().getUserName();
111+
StringsuperAdminPassword =commonConfig.getSuperAdmin().getPassword();
112+
if (StringUtils.equalsIgnoreCase(email,superAdminEmail) &&StringUtils.equals(password,superAdminPassword)) {
113+
// Allow superadmin login even if EMAIL provider is disabled
114+
returnMono.just(findAuthConfig);
115+
}
116+
}
117+
// --- Superadmin check end ---
105118
if(!findAuthConfig.authConfig().getEnable()) {
106119
returnMono.error(newBizException(EMAIL_PROVIDER_DISABLED,"EMAIL_PROVIDER_DISABLED"));
107120
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp