Skip to main content

migrate_email_bindings

Function migrate_email_bindings 

Source
pub(super) async fn migrate_email_bindings(services: &Services) -> Result
Expand description

Adopts the email addresses a foreign database binds in a column of its own.

Some databases hold one address per localpart in their own column rather than in the third-party identifier store this server reads, so the binding is invisible here and the address looks unclaimed. Adopting it keeps the address answering for its owner, which is what an account authenticated by an identity provider carries instead of a password.

Addresses are taken one at a time because two foreign addresses can fold onto one canonical key, and a concurrent pass would clear both through the in-use check before either wrote the reverse row.