mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 15:32:25 -05:00
[feature] Implement /oauth/revoke for token revocation (#3983)
This commit is contained in:
parent
b1a4d54c14
commit
e032c959e1
8 changed files with 522 additions and 9 deletions
|
|
@ -18,6 +18,7 @@
|
|||
package processing
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"codeberg.org/superseriousbusiness/oauth2/v4"
|
||||
|
|
@ -38,3 +39,17 @@ func (p *Processor) OAuthValidateBearerToken(r *http.Request) (oauth2.TokenInfo,
|
|||
// todo: some kind of metrics stuff here
|
||||
return p.oauthServer.ValidationBearerToken(r)
|
||||
}
|
||||
|
||||
func (p *Processor) OAuthRevokeAccessToken(
|
||||
ctx context.Context,
|
||||
clientID string,
|
||||
clientSecret string,
|
||||
accessToken string,
|
||||
) gtserror.WithCode {
|
||||
return p.oauthServer.RevokeAccessToken(
|
||||
ctx,
|
||||
clientID,
|
||||
clientSecret,
|
||||
accessToken,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue