From eb782ee9eb31bf1767bd7b234f73a1f63504fd32 Mon Sep 17 00:00:00 2001 From: sjyu1 <93505580+sjyu1@users.noreply.github.com> Date: Thu, 28 Aug 2025 11:28:13 +0900 Subject: [PATCH] =?UTF-8?q?sso=20=EB=A1=9C=EA=B7=B8=EC=95=84=EC=9B=83?= =?UTF-8?q?=EC=8B=9C=20=ED=86=A0=ED=81=B0=EA=B0=92=20=EB=A9=94=EB=AA=A8?= =?UTF-8?q?=EB=A6=AC->db=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/models/usertoken/user_token.go | 2 +- pkg/services/auth/auth.go | 1 + pkg/services/auth/authimpl/auth_token.go | 9 +++++---- pkg/services/auth/authimpl/model.go | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/models/usertoken/user_token.go b/pkg/models/usertoken/user_token.go index e7940a4d0ffd2..ef66905e4d983 100644 --- a/pkg/models/usertoken/user_token.go +++ b/pkg/models/usertoken/user_token.go @@ -36,7 +36,7 @@ type UserToken struct { UpdatedAt int64 RevokedAt int64 UnhashedToken string - IdToken string `xorm:"-" json:"-"` + IdToken string } const UrgentRotateTime = 1 * time.Minute diff --git a/pkg/services/auth/auth.go b/pkg/services/auth/auth.go index 88ff4d0615735..fefb56133dd41 100644 --- a/pkg/services/auth/auth.go +++ b/pkg/services/auth/auth.go @@ -71,6 +71,7 @@ type CreateTokenCommand struct { ClientIP net.IP UserAgent string ExternalSession *ExternalSession + IdToken string } // UserTokenService are used for generating and validating user tokens diff --git a/pkg/services/auth/authimpl/auth_token.go b/pkg/services/auth/authimpl/auth_token.go index 01e8fd1da75d2..4927a05d7f6ca 100644 --- a/pkg/services/auth/authimpl/auth_token.go +++ b/pkg/services/auth/authimpl/auth_token.go @@ -94,7 +94,7 @@ func (s *UserAuthTokenService) CreateToken(ctx context.Context, cmd *auth.Create SeenAt: 0, RevokedAt: 0, AuthTokenSeen: false, - // IdToken: cmd.IdToken, + IdToken: cmd.IdToken, } err = s.sqlStore.InTransaction(ctx, func(ctx context.Context) error { @@ -124,9 +124,10 @@ func (s *UserAuthTokenService) CreateToken(ctx context.Context, cmd *auth.Create var userToken auth.UserToken err = userAuthToken.toUserToken(&userToken) - if cmd.IdToken != "" { - userToken.IdToken = cmd.IdToken - } + // 메모리저장 테스트 + // if cmd.IdToken != "" { + // userToken.IdToken = cmd.IdToken + // } return &userToken, err } diff --git a/pkg/services/auth/authimpl/model.go b/pkg/services/auth/authimpl/model.go index ebf20b09c9ade..a961712813b05 100644 --- a/pkg/services/auth/authimpl/model.go +++ b/pkg/services/auth/authimpl/model.go @@ -21,7 +21,7 @@ type userAuthToken struct { RevokedAt int64 UnhashedToken string `xorm:"-"` ExternalSessionId int64 - IdToken string `xorm:"-"` + IdToken string } func userAuthTokenFromUserToken(ut *auth.UserToken) (*userAuthToken, error) {