MCPcopy Create free account
hub / github.com/gogs/gogs / SignOut

Function SignOut

internal/route/user/auth.go:285–296  ·  view source on GitHub ↗
(c *context.Context)

Source from the content-addressed store, hash-verified

283}
284
285func SignOut(c *context.Context) {
286 _ = c.Session.Flush()
287 _ = c.Session.Destory(c.Context)
288 c.SetCookie(conf.Security.CookieUsername, "", -1, conf.Server.Subpath)
289 c.SetCookie(conf.Security.CookieRememberName, "", -1, conf.Server.Subpath)
290 c.SetCookie(conf.Session.CSRFCookieName, "", -1, conf.Server.Subpath)
291 if conf.Auth.CustomLogoutURL != "" {
292 c.Redirect(conf.Auth.CustomLogoutURL)
293 return
294 }
295 c.RedirectSubpath("/")
296}
297
298func SignUp(c *context.Context) {
299 c.Title("sign_up")

Callers

nothing calls this directly

Calls 3

SetCookieMethod · 0.80
RedirectMethod · 0.80
RedirectSubpathMethod · 0.80

Tested by

no test coverage detected