summaryrefslogtreecommitdiff
path: root/internal/api/auth/auth.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2025-04-10 16:24:17 +0200
committerLibravatar GitHub <noreply@github.com>2025-04-10 16:24:17 +0200
commite032c959e13bc276d8517a51857e1c772c151f95 (patch)
tree04b33f2202c56ff340246ebeb67d1550c821380e /internal/api/auth/auth.go
parent[chore] add IPPrefixes type so we don't need separate rate limit parsed field... (diff)
downloadgotosocial-e032c959e13bc276d8517a51857e1c772c151f95.tar.xz
[feature] Implement /oauth/revoke for token revocation (#3983)
Diffstat (limited to 'internal/api/auth/auth.go')
-rw-r--r--internal/api/auth/auth.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/api/auth/auth.go b/internal/api/auth/auth.go
index f9dcb87ea..37c4e864a 100644
--- a/internal/api/auth/auth.go
+++ b/internal/api/auth/auth.go
@@ -46,6 +46,7 @@ const (
OauthFinalizePath = "/finalize"
OauthOOBTokenPath = "/oob" // #nosec G101 else we get a hardcoded credentials warning
OauthTokenPath = "/token" // #nosec G101 else we get a hardcoded credentials warning
+ OauthRevokePath = "/revoke"
/*
params / session keys
@@ -100,6 +101,7 @@ func (m *Module) RouteAuth(attachHandler func(method string, path string, f ...g
// RouteOAuth routes all paths that should have an 'oauth' prefix
func (m *Module) RouteOAuth(attachHandler func(method string, path string, f ...gin.HandlerFunc) gin.IRoutes) {
attachHandler(http.MethodPost, OauthTokenPath, m.TokenPOSTHandler)
+ attachHandler(http.MethodPost, OauthRevokePath, m.TokenRevokePOSTHandler)
attachHandler(http.MethodGet, OauthAuthorizePath, m.AuthorizeGETHandler)
attachHandler(http.MethodPost, OauthAuthorizePath, m.AuthorizePOSTHandler)
attachHandler(http.MethodPost, OauthFinalizePath, m.FinalizePOSTHandler)