mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-09 13:28:44 +00:00
Revoke oauth token on signout
This commit is contained in:
parent
df031d5edd
commit
b83a00aa2c
3 changed files with 18 additions and 0 deletions
|
@ -902,6 +902,10 @@ func (s *service) Signin(c *client, code string) (err error) {
|
|||
return c.setSession(c.s)
|
||||
}
|
||||
|
||||
func (s *service) Signout(c *client) (err error) {
|
||||
return c.RevokeToken(c.ctx)
|
||||
}
|
||||
|
||||
func (s *service) Post(c *client, content string, replyToID string,
|
||||
format string, visibility string, isNSFW bool,
|
||||
files []*multipart.FileHeader) (id string, err error) {
|
||||
|
|
|
@ -676,6 +676,10 @@ func NewHandler(s *service, verbose bool, staticDir string) http.Handler {
|
|||
}, CSRF, HTML)
|
||||
|
||||
signout := handle(func(c *client) error {
|
||||
err := s.Signout(c)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.unsetSession()
|
||||
c.redirect("/")
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue