lvshaokang commented on code in PR #1840:
URL:
https://github.com/apache/incubator-streampark/pull/1840#discussion_r999385353
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/controller/PassportController.java:
##########
@@ -102,6 +110,54 @@ public RestResponse signin(
return new RestResponse().data(userInfo);
}
+ @PostMapping("signinbycasdoor")
+ public RestResponse signinByCasdoor(@NotBlank(message = "{required}")
String code,
+ @NotBlank(message = "{required}")
String state) {
+ String token = "";
+ String username = "";
+ String password = "";
+ token = casdoorAuthService.getOAuthToken(code, state);
+ CasdoorUser casdoorUser = casdoorAuthService.parseJwtToken(token);
+ User user = userService.findByName(casdoorUser.getName());
+ if (user == null) {
+ User user2 = new User();
Review Comment:
It is not recommended to use the variable name "user2", because it does not
provide a clearly meaning
##########
streampark-console/streampark-console-service/src/main/resources/application.properties:
##########
@@ -0,0 +1,53 @@
+#
Review Comment:
Is there additional configuration to enable it, enforcing it is not
expected, and we want the user to have the choice.
##########
streampark-console/streampark-console-service/src/main/resources/application.properties:
##########
@@ -0,0 +1,53 @@
+#
Review Comment:
Could this file be renamed `casdoor.properties`, it seems to be a
casdoor-only configuration
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/controller/PassportController.java:
##########
@@ -102,6 +109,46 @@ public RestResponse signin(
return new RestResponse().data(userInfo);
}
+ @PostMapping("signinbycasdoor")
+ public RestResponse signinByCasdoor(@NotBlank(message = "{required}")
String code,
+ @NotBlank(message = "{required}")
String state) throws Exception {
+ String token = "";
Review Comment:
@jakiuncle Sorry, I ignored the transaction handling, let's revert to the
original, and we'll discuss using unified business code to handle exceptions
later, feel free to join the discussion
--
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]