Sub-Task #124
Updated by Bricklou 22 days ago
Technical specification of the profile sync on sign-in through a login provider. * When an account that is linked to a provider signs in through it, the profile follows the provider's claims: username and email. The avatar joins them username, email and, once avatars exist (#108). (#108), the avatar. * The provider is the source of truth, which is why the profile is read-only for these accounts (#109). * The username is the provider's preferred username, then its name. It is applied when it is valid and free. * The email is applied only when the provider vouches for it, when it is valid and free. It then counts as verified. * Each change is written to the change log and announced as a profile change. * A value claim that breaks would break a rule or belongs to (username taken, email used by another account account, invalid value) is skipped and logged. A failure of logged; the sync is logged too. The sign-in succeeds in every case. still succeeds. * A suspended account Today the sign-in only resolves the account; nothing is refused before anything is synced. synced yet. Acceptance criteria: * [x] [ ] A changed username or email at the provider is applied at the next sign-in. * [x] An email the provider does not vouch for is not applied. * [x] [ ] A value claim that conflicts with another account is skipped and the sign-in succeeds. * [x] [ ] Each applied change is in the change log. * [x] [ ] Every case is covered by a test, with a real database.