Skip to content

Commit

Permalink
export withUser
Browse files Browse the repository at this point in the history
  • Loading branch information
klaidliadon committed Oct 25, 2024
1 parent ed35ec3 commit 67ca5c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ func GetAccount(ctx context.Context) (string, bool) {
// User
//

// withUser adds the user to the context.
func withUser(ctx context.Context, user any) context.Context {
// WithUser adds the user to the context.
func WithUser(ctx context.Context, user any) context.Context {
return context.WithValue(ctx, ctxKeyUser, user)
}

Expand Down
2 changes: 1 addition & 1 deletion middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func Session(cfg *Options) func(next http.Handler) http.Handler {
}

if user != nil {
ctx = withUser(ctx, user)
ctx = WithUser(ctx, user)

sessionType = proto.SessionType_User
if isAdmin {
Expand Down

0 comments on commit 67ca5c3

Please sign in to comment.