mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-17 23:03:00 -06:00
20 lines
426 B
Go
20 lines
426 B
Go
package auth
|
|
|
|
import (
|
|
"github.com/gin-contrib/sessions"
|
|
"github.com/superseriousbusiness/gotosocial/internal/router"
|
|
)
|
|
|
|
func (m *Module) clearSession(s sessions.Session) {
|
|
for _, key := range sessionKeys {
|
|
s.Delete(key)
|
|
}
|
|
|
|
newOptions := router.SessionOptions(m.config)
|
|
newOptions.MaxAge = -1 // instruct browser to delete cookie immediately
|
|
s.Options(newOptions)
|
|
|
|
if err := s.Save(); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|