From 51129644e391a274c375a88b7ed27840d0f016d6 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 23 Nov 2022 13:42:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20OA?= =?UTF-8?q?uth2=E7=94=A8=E6=88=B7=E7=A6=81=E7=94=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1020043 --user=李玉号 【系统设置】OAuth2禁用失败 https://www.tapd.cn/55049933/s/1302563 --- .../main/java/io/metersphere/gateway/service/SSOService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/framework/gateway/src/main/java/io/metersphere/gateway/service/SSOService.java b/framework/gateway/src/main/java/io/metersphere/gateway/service/SSOService.java index 23a492d35a..317f9fb95f 100644 --- a/framework/gateway/src/main/java/io/metersphere/gateway/service/SSOService.java +++ b/framework/gateway/src/main/java/io/metersphere/gateway/service/SSOService.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.type.TypeReference; import io.metersphere.base.domain.AuthSource; import io.metersphere.base.domain.User; import io.metersphere.commons.constants.UserSource; +import io.metersphere.commons.constants.UserStatus; import io.metersphere.commons.exception.MSException; import io.metersphere.commons.user.SessionUser; import io.metersphere.commons.utils.*; @@ -307,6 +308,9 @@ public class SSOService { if (!StringUtils.equals(u.getSource(), UserSource.OAuth2.name())) { MSException.throwException("user already exist, user source type is " + u.getSource()); } + if (StringUtils.equals(u.getStatus(), UserStatus.DISABLED)) { + MSException.throwException("user is disabled!"); + } } LoginRequest loginRequest = new LoginRequest();