MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / AuthenticateRequest

Method AuthenticateRequest

internal/auth/auth.go:519–529  ·  view source on GitHub ↗

AuthenticateRequest extracts the user from the session cookie. Returns nil if not authenticated.

(r *http.Request)

Source from the content-addressed store, hash-verified

517
518// AuthenticateRequest extracts the user from the session cookie. Returns nil if not authenticated.
519func (ua *UserAuth) AuthenticateRequest(r *http.Request) *identity.User {
520 cookie, err := r.Cookie(SessionCookieName)
521 if err != nil {
522 return nil
523 }
524 user, err := ua.store.GetUserSession(r.Context(), cookie.Value)
525 if err != nil {
526 return nil
527 }
528 return user
529}
530
531type googleUserInfo struct {
532 Sub string `json:"sub"`

Callers 14

HandleMeMethod · 0.95
HandleUpdateMeMethod · 0.95
HandleDashboardStatsMethod · 0.95
HandleDashboardAgentsMethod · 0.95
HandleDeleteAgentMethod · 0.95
HandleUpdateAgentMethod · 0.95
HandleAgentActivityMethod · 0.95
HandleCreateAPIKeyMethod · 0.95
HandleListAPIKeysMethod · 0.95
HandleDeleteAPIKeyMethod · 0.95
authenticatePrincipalMethod · 0.80
handleFeedbackMethod · 0.80

Calls 1

GetUserSessionMethod · 0.80

Tested by

no test coverage detected