feat: add profile sync
This commit is contained in:
@@ -28,7 +28,7 @@ func (m Middleware) RequireAuth(next http.Handler) http.Handler {
|
||||
return
|
||||
}
|
||||
|
||||
next.ServeHTTP(w, r.WithContext(withPrincipal(r.Context(), principal)))
|
||||
next.ServeHTTP(w, r.WithContext(ContextWithPrincipal(r.Context(), principal)))
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ func PrincipalFromContext(ctx context.Context) (Principal, bool) {
|
||||
return principal, ok
|
||||
}
|
||||
|
||||
func withPrincipal(ctx context.Context, principal Principal) context.Context {
|
||||
func ContextWithPrincipal(ctx context.Context, principal Principal) context.Context {
|
||||
return context.WithValue(ctx, principalContextKey{}, principal)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user