mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-18 01:03:01 -06:00
further oidc
This commit is contained in:
parent
8e0d32d3e1
commit
81206d93f3
14 changed files with 227 additions and 70 deletions
20
internal/api/client/auth/util.go
Normal file
20
internal/api/client/auth/util.go
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue