mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 17:32:25 -05:00
handle oauth token scope, fix user.SigninCount + token.UserID
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
This commit is contained in:
parent
fce3ba6382
commit
d2a85f2f5f
3 changed files with 6 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue