fix: add id_token and support auth header (#338)

This commit is contained in:
Товарищ программист
2021-11-28 16:19:42 +08:00
committed by Gucheng Wang
parent 7923bffa6d
commit e888ff8475
2 changed files with 6 additions and 0 deletions

View File

@ -150,6 +150,10 @@ func (c *ApiController) GetOAuthToken() {
clientSecret := c.Input().Get("client_secret")
code := c.Input().Get("code")
if clientId == "" && clientSecret == "" {
clientId, clientSecret, _ = c.Ctx.Request.BasicAuth()
}
c.Data["json"] = object.GetOAuthToken(grantType, clientId, clientSecret, code)
c.ServeJSON()
}