authenticateUser is the user-only convenience over authenticatePrincipal, retained for the legacy mux handlers (OAuth / session auth) that do not enforce the v1 scope ceiling.
(r *http.Request)
| 687 | // authenticateUser is the user-only convenience over authenticatePrincipal, |
| 688 | // retained for the legacy mux handlers (OAuth / session auth) that do not enforce the v1 scope ceiling. |
| 689 | func (a *API) authenticateUser(r *http.Request) (*identity.User, error) { |
| 690 | p, err := a.authenticatePrincipal(r) |
| 691 | if err != nil { |
| 692 | return nil, err |
| 693 | } |
| 694 | return p.User, nil |
| 695 | } |
| 696 | |
| 697 | func (a *API) authenticatePrincipal(r *http.Request) (*identity.Principal, error) { |
| 698 | authHeader := r.Header.Get("Authorization") |