sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.14k stars 207 forks source link

auth/sso: if update_on_login is set, update email_address if it does not exist #7561

Open haraldschilly opened 2 months ago

haraldschilly commented 2 months ago

This is only relevant if you primarily use an SSO solution and want to automatically update the name and email_address of your users. i.e. if the SSO setting update_on_login is true.

Right now server/auth/sso/passport-login::maybeUpdateAccountAndPassport only updates the name, but skips the email address. It should rather check if the new email address isn't already associated with another account – if not, then change it for the user. That way, no accidental account takeover happens.