HandleMe returns the current authenticated user's info.
(w http.ResponseWriter, r *http.Request)
| 452 | |
| 453 | // HandleMe returns the current authenticated user's info. |
| 454 | func (ua *UserAuth) HandleMe(w http.ResponseWriter, r *http.Request) { |
| 455 | user := ua.AuthenticateRequest(r) |
| 456 | if user == nil { |
| 457 | http.Error(w, "not authenticated", http.StatusUnauthorized) |
| 458 | return |
| 459 | } |
| 460 | w.Header().Set("Content-Type", "application/json") |
| 461 | writeJSON(w, user) |
| 462 | } |
| 463 | |
| 464 | // HandleUpdateMe accepts a PATCH that updates the authenticated user's |
| 465 | // display name. Other identity fields (email, google_subject) come from |
nothing calls this directly
no test coverage detected