(w http.ResponseWriter, r *http.Request)
| 68 | var errAuthCookie = errors.DefineUnauthenticated("auth_cookie", "get auth cookie") |
| 69 | |
| 70 | func (s *Session) getAuthCookie(w http.ResponseWriter, r *http.Request) (cookie auth.CookieShape, err error) { |
| 71 | ok, err := s.authCookie().Get(w, r, &cookie) |
| 72 | if err != nil { |
| 73 | return cookie, err |
| 74 | } |
| 75 | if !ok { |
| 76 | return cookie, errAuthCookie.New() |
| 77 | } |
| 78 | return cookie, nil |
| 79 | } |
| 80 | |
| 81 | // UpdateAuthCookie updates the current authentication cookie. |
| 82 | func (s *Session) UpdateAuthCookie(w http.ResponseWriter, r *http.Request, update func(value *auth.CookieShape) error) error { |
no test coverage detected