MCPcopy Index your code
hub / github.com/screego/server / CurrentUser

Method CurrentUser

auth/auth.go:80–87  ·  view source on GitHub ↗
(r *http.Request)

Source from the content-addressed store, hash-verified

78}
79
80func (u *Users) CurrentUser(r *http.Request) (string, bool) {
81 s, _ := u.store.Get(r, "user")
82 user, ok := s.Values["user"].(string)
83 if !ok {
84 return "guest", ok
85 }
86 return user, ok
87}
88
89func (u *Users) Logout(w http.ResponseWriter, r *http.Request) {
90 session := sessions.NewSession(u.store, "user")

Callers 2

RouterFunction · 0.80
UpgradeMethod · 0.80

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected