Content-Length: 2417 | pFad | http://github.com/lowcoder-org/lowcoder/pull/1655.diff
thub.com
diff --git a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/authentication/service/AuthenticationApiServiceImpl.java b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/authentication/service/AuthenticationApiServiceImpl.java
index 4c1dee60d..ff15c8187 100644
--- a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/authentication/service/AuthenticationApiServiceImpl.java
+++ b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/authentication/service/AuthenticationApiServiceImpl.java
@@ -98,10 +98,23 @@ protected Mono authenticate(String authId, @Deprecated String source,
})
.flatMap(findAuthConfig -> {
context.setAuthConfig(findAuthConfig.authConfig());
+ // Check if email/password is superadmin before checking EMAIL provider enable
if (findAuthConfig.authConfig().getSource().equals("EMAIL")) {
- if(StringUtils.isBlank(context.getOrgId())) {
+ if (StringUtils.isBlank(context.getOrgId())) {
context.setOrgId(Optional.ofNullable(findAuthConfig.organization()).map(Organization::getId).orElse(null));
}
+ // --- Superadmin check start ---
+ if (context instanceof FormAuthRequestContext formContext) {
+ String email = formContext.getLoginId();
+ String password = formContext.getPassword();
+ String superAdminEmail = commonConfig.getSuperAdmin().getUserName();
+ String superAdminPassword = commonConfig.getSuperAdmin().getPassword();
+ if (StringUtils.equalsIgnoreCase(email, superAdminEmail) && StringUtils.equals(password, superAdminPassword)) {
+ // Allow superadmin login even if EMAIL provider is disabled
+ return Mono.just(findAuthConfig);
+ }
+ }
+ // --- Superadmin check end ---
if(!findAuthConfig.authConfig().getEnable()) {
return Mono.error(new BizException(EMAIL_PROVIDER_DISABLED, "EMAIL_PROVIDER_DISABLED"));
}
--- a PPN by Garber Painting Akron. With Image Size Reduction included!Fetched URL: http://github.com/lowcoder-org/lowcoder/pull/1655.diff
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy