mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
handle oauth token scope, fix user.SigninCount + token.UserID
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user