You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/05/07 12:57:12 UTC

[GitHub] [dolphinscheduler] CalvinKirs commented on a change in pull request #5422: [Improvement][api] optimize api controller with AuthUtil

CalvinKirs commented on a change in pull request #5422:
URL: https://github.com/apache/dolphinscheduler/pull/5422#discussion_r628189026



##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java
##########
@@ -74,20 +72,18 @@
     @PostMapping(value = "/create")
     @ResponseStatus(HttpStatus.CREATED)
     @ApiException(CREATE_ACCESS_TOKEN_ERROR)
-    @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
-    public Result createToken(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
-                              @RequestParam(value = "userId") int userId,
+    @AccessLogAnnotation()
+    public Result createToken(@RequestParam(value = "userId") int userId,
                               @RequestParam(value = "expireTime") String expireTime,
                               @RequestParam(value = "token") String token) {
 
-        Map<String, Object> result = accessTokenService.createToken(loginUser, userId, expireTime, token);
+        Map<String, Object> result = accessTokenService.createToken(AuthUtils.getLoginUser(), userId, expireTime, token);

Review comment:
       What is the significance of this change?




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org