V3Login handles login
(w http.ResponseWriter, r *http.Request)
| 222 | |
| 223 | // V3Login handles login |
| 224 | func (u *Users) V3Login(w http.ResponseWriter, r *http.Request) { |
| 225 | var form LoginForm |
| 226 | if err := parseRequestData(r, &form); err != nil { |
| 227 | handleJSONError(w, err, "parsing payload") |
| 228 | return |
| 229 | } |
| 230 | |
| 231 | session, err := u.login(form) |
| 232 | if err != nil { |
| 233 | handleJSONError(w, err, "logging in user") |
| 234 | return |
| 235 | } |
| 236 | |
| 237 | respondWithSession(w, http.StatusOK, session) |
| 238 | } |
| 239 | |
| 240 | func (u *Users) logout(r *http.Request) (bool, error) { |
| 241 | key, err := GetCredential(r) |
nothing calls this directly
no test coverage detected