From 19ef97a7ece4533ff7560f1d71ef90695b8ab8b9 Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 16 Sep 2022 21:45:56 +0800 Subject: [PATCH] chore: update dev version --- server/acl.go | 30 ++++++++++++++++-------------- server/version/version.go | 2 +- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/server/acl.go b/server/acl.go index 371cb112..b0d4a6ad 100644 --- a/server/acl.go +++ b/server/acl.go @@ -64,20 +64,22 @@ func aclMiddleware(s *Server, next echo.HandlerFunc) echo.HandlerFunc { return next(c) } - // If there is openId in query string and related user is found, then skip auth. - openID := c.QueryParam("openId") - if openID != "" { - userFind := &api.UserFind{ - OpenID: &openID, - } - user, err := s.Store.FindUser(ctx, userFind) - if err != nil && common.ErrorCode(err) != common.NotFound { - return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find user by open_id").SetInternal(err) - } - if user != nil { - // Stores userID into context. - c.Set(getUserIDContextKey(), user.ID) - return next(c) + { + // If there is openId in query string and related user is found, then skip auth. + openID := c.QueryParam("openId") + if openID != "" { + userFind := &api.UserFind{ + OpenID: &openID, + } + user, err := s.Store.FindUser(ctx, userFind) + if err != nil && common.ErrorCode(err) != common.NotFound { + return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find user by open_id").SetInternal(err) + } + if user != nil { + // Stores userID into context. + c.Set(getUserIDContextKey(), user.ID) + return next(c) + } } } diff --git a/server/version/version.go b/server/version/version.go index 24d3fe11..f2abb8f0 100644 --- a/server/version/version.go +++ b/server/version/version.go @@ -10,7 +10,7 @@ import ( var Version = "0.4.3" // DevVersion is the service current development version. -var DevVersion = "0.5.0" +var DevVersion = "0.4.4" func GetCurrentVersion(mode string) string { if mode == "dev" {