MCPcopy Create free account
hub / github.com/tinyauthapp/tinyauth / DeleteSessionCookie

Method DeleteSessionCookie

internal/service/auth_service.go:387–403  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

385}
386
387func (auth *AuthService) DeleteSessionCookie(c *gin.Context) error {
388 cookie, err := c.Cookie(auth.config.SessionCookieName)
389
390 if err != nil {
391 return err
392 }
393
394 err = auth.queries.DeleteSession(c, cookie)
395
396 if err != nil {
397 return err
398 }
399
400 c.SetCookie(auth.config.SessionCookieName, "", -1, "/", fmt.Sprintf(".%s", auth.config.CookieDomain), auth.config.SecureCookie, true)
401
402 return nil
403}
404
405func (auth *AuthService) GetSessionCookie(c *gin.Context) (repository.Session, error) {
406 cookie, err := c.Cookie(auth.config.SessionCookieName)

Callers 2

MiddlewareMethod · 0.80
logoutHandlerMethod · 0.80

Calls 1

DeleteSessionMethod · 0.80

Tested by

no test coverage detected