MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / getAuthCookie

Method getAuthCookie

pkg/account/session/session.go:70–79  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

68var errAuthCookie = errors.DefineUnauthenticated("auth_cookie", "get auth cookie")
69
70func (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.
82func (s *Session) UpdateAuthCookie(w http.ResponseWriter, r *http.Request, update func(value *auth.CookieShape) error) error {

Callers 1

GetMethod · 0.95

Calls 3

authCookieMethod · 0.95
GetMethod · 0.65
NewMethod · 0.65

Tested by

no test coverage detected