From d2a85f2f5fcadf8366ee611d7f10b3767277817b Mon Sep 17 00:00:00 2001 From: "kim (grufwub)" Date: Wed, 8 Sep 2021 20:46:08 +0100 Subject: handle oauth token scope, fix user.SigninCount + token.UserID Signed-off-by: kim (grufwub) --- internal/api/client/auth/token.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'internal/api/client/auth') 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 { -- cgit v1.2.3