MCPcopy Index your code
hub / github.com/dnote/dnote / V3Login

Method V3Login

pkg/server/controllers/users.go:224–238  ·  view source on GitHub ↗

V3Login handles login

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

222
223// V3Login handles login
224func (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
240func (u *Users) logout(r *http.Request) (bool, error) {
241 key, err := GetCredential(r)

Callers

nothing calls this directly

Calls 4

loginMethod · 0.95
parseRequestDataFunction · 0.85
handleJSONErrorFunction · 0.85
respondWithSessionFunction · 0.85

Tested by

no test coverage detected