Gallardot commented on code in PR #16669:
URL:
https://github.com/apache/dolphinscheduler/pull/16669#discussion_r1777942108
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java:
##########
@@ -158,7 +158,8 @@ public Result ssoLogin(HttpServletRequest request) {
if (session.getAttribute(Constants.SSO_LOGIN_USER_STATE) == null) {
session.setAttribute(Constants.SSO_LOGIN_USER_STATE,
randomState);
}
- return Result.success(((AbstractSsoAuthenticator)
authenticator).getSignInUrl(randomState));
+ return Result.success(((AbstractSsoAuthenticator) authenticator)
+
.getSignInUrl(session.getAttribute(Constants.SSO_LOGIN_USER_STATE).toString()));
Review Comment:
LGTM. Let's make it better.
```java
HttpSession session = request.getSession();
if (session.getAttribute(Constants.SSO_LOGIN_USER_STATE) ==
null) {
String randomState = UUID.randomUUID().toString();
session.setAttribute(Constants.SSO_LOGIN_USER_STATE,
randomState);
}
return Result.success(((AbstractSsoAuthenticator) authenticator)
.getSignInUrl(session.getAttribute(Constants.SSO_LOGIN_USER_STATE).toString()));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]