调整 SSO 不一致问题

Most profile fields can already be specified during the SSO process which is super-useful. From username to name, to bio, and even website was added last year. But, there’s some still minor quirks:

  • location seems to be missing — from a cursory look, seems to be the only obvious field that isn’t possible to change using SSO.
  • website can be specified during SSO, but unlike most (all?) other SSO profile fields, it doesn’t have a corresponding site setting to allow overriding the local value and prevent user from changing it.

I’m guessing these were just overlooked as the code base grew over time, as I can’t think of a reason for these exceptions. Unfortunately my Ruby and Discourse knowledge isn’t enough to submit a PR, but I wanted to report it — perhaps someone has the technical chops to do it.

我已经实现了上述两项功能的更改。我很乐意将这些更改贡献回 Discourse,但我不确定上游是否对此感兴趣?/cc @sam

在我费尽周折提交 PR 之前,请告诉我。代码已经可以运行,但由于我是 Discourse 的新手,可能还需要一些修改或调整。

请开始创建 PR 以便完成 CLA 流程,但:

这似乎并不值得费心处理——该页面上的其他字段(如用户卡片背景图像)在 SSO 平台中也无法使用,因此为 website 字段添加锁定并不能带来一致性优势。

1 个赞

抱歉,我不太确定你刚才的意思。我同意卡片背景在 SSO 场景下用途有限(尽管该功能已实现)。website 本身也是一个已实现的 SSO 字段——我只新增了一个 sso_overrides_website 设置,类似于已存在的针对用户名、头像、简介等字段的设置,这样就能禁止本地修改,让 SSO 的值优先生效。