Discourse OAuth2 基础

对我来说,唯一剩下的问题和 @nodomain 的一样:账户创建成功了,但头像没有包含在内。示例响应:

Body: {
  "access_token":"...",
  "token_type":"bearer",
  "expires_in":"3600",
  "scope":"profile",
  "profile" : {
    "id":1234,
    "email": "...",
    "name": "...",
    "picture": "https://somedomain.com/somevalidpicture.jpg"
  }
}

并且它被正确解析了,因为它出现在以下日志中:

OAuth2 Debugging: after_authenticate response:

creds: {"token"=>"...", "expires_at"=>1702053692, "expires"=>true}
uid: 1234
info: {"email"=>"...", "name"=>"...", "avatar"=>"https://somedomain.com/somevalidpicture.jpg"}
extra: {}

我检查了图片地址是正确的,并且尺寸是 300x300。

关于这个问题有什么想法吗?

编辑:有人刚创建了一个账户,它从 Gravatar 获取了图片。也许 JSON 中的有效图片被 Gravatar 返回的空白结果覆盖了?