Documentation
¶
Overview ¶
Package login is the session: log in, log out, and who is asking.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler(db bun.IDB) http.HandlerFunc
Handler logs in: POST /api/login. The session token goes in an HttpOnly cookie, in the body only when the input asks it (the CLI). @Summary Log in @Tags session @Accept json @Produce json @Param body body createsession.Input true "body" @Success 200 {object} createsession.Result @Failure 400 {object} respond.Failure @Failure 401 {object} respond.Failure @Failure 429 {object} respond.Failure @Router /api/login [post]
func Logout ¶
func Logout(db bun.IDB) http.HandlerFunc
Logout logs this device out: POST /api/logout. @Summary Log out @Tags session @Success 204 @Failure 401 {object} respond.Failure @Router /api/logout [post]
func Me ¶
func Me() http.HandlerFunc
Me is who asks: GET /api/me. @Summary Who is asking @Tags session @Produce json @Success 200 {object} login.MeResult @Failure 401 {object} respond.Failure @Router /api/me [get]