summaryrefslogtreecommitdiff
path: root/internal/api/client
diff options
context:
space:
mode:
authorLibravatar kim (grufwub) <grufwub@gmail.com>2021-09-08 20:46:08 +0100
committerLibravatar kim (grufwub) <grufwub@gmail.com>2021-09-08 20:46:08 +0100
commitd2a85f2f5fcadf8366ee611d7f10b3767277817b (patch)
treeaba49cde357acb350141cfdf83f385c7ddb0c2c9 /internal/api/client
parentupdate oauth library -> v4.3.1-SSB (diff)
downloadgotosocial-d2a85f2f5fcadf8366ee611d7f10b3767277817b.tar.xz
handle oauth token scope, fix user.SigninCount + token.UserID
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
Diffstat (limited to 'internal/api/client')
-rw-r--r--internal/api/client/auth/token.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/api/client/auth/token.go b/internal/api/client/auth/token.go
index 798a88d19..7e590aa1f 100644
--- a/internal/api/client/auth/token.go
+++ b/internal/api/client/auth/token.go
@@ -31,6 +31,7 @@ type tokenBody struct {
Code *string `form:"code" json:"code" xml:"code"`
GrantType *string `form:"grant_type" json:"grant_type" xml:"grant_type"`
RedirectURI *string `form:"redirect_uri" json:"redirect_uri" xml:"redirect_uri"`
+ Scope *string `form:"scope" json:"scope" xml:"scope"`
}
// TokenPOSTHandler should be served as a POST at https://example.org/oauth/token
@@ -58,6 +59,9 @@ func (m *Module) TokenPOSTHandler(c *gin.Context) {
if form.RedirectURI != nil {
c.Request.Form.Set("redirect_uri", *form.RedirectURI)
}
+ if form.Scope != nil {
+ c.Request.Form.Set("scope", *form.Scope)
+ }
}
if err := m.server.HandleTokenRequest(c.Writer, c.Request); err != nil {