Skip to content

Commit 493fa69

Browse files
authored
fix: skip set project id from access key when already set by project jwt (#52)
1 parent f018021 commit 493fa69

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

middleware.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,9 @@ func Session(cfg Options) func(next http.Handler) http.Handler {
250250
sessionType = max(sessionType, proto.SessionType_AccessKey)
251251

252252
ctx = WithAccessKey(ctx, accessKey)
253-
254-
projectID, _ = GetProjectIDFromAccessKey(accessKey)
253+
if projectID == 0 {
254+
projectID, _ = GetProjectIDFromAccessKey(accessKey)
255+
}
255256
ctx = withProjectID(ctx, projectID)
256257
httplog.SetAttrs(ctx, slog.Uint64("projectId", projectID))
257258
break

0 commit comments

Comments
 (0)