Fix crash 'Duplicate entry' in account creation via external GitHub auth
Summary:
Do not recreate the thumbnail profile picture via a file transform when creating a Phorge account via external authentication via GitLab but use the already existing thumbnail file. This saves database space and fixes this crash:
#1062: Duplicate entry 'PHID-FILE-ffps4pzs36kkikrpvgdh-profile' for key 'originalPHID'
Closes T16532
Ref T16527
Ref T16528
Co-authored-by: Andre Klapper
Test Plan:
Prepare GitHub OAuth:
* Log into Github, create a new OAuth App via https://github.com/settings/applications/new
* As an admin, set up GitHub Auth provider via http://phorge.localhost/auth/
* Copy Client ID into "OAuth App ID" and Client Secret into "OAuth App Secret"
* Log out as admin
Then:
* Go to http://phorge.localhost/auth/start/ and click GitHub button
* Enter Username and Password on GitHub website, click "Sign in"
* Enter data on resulting http://phorge.localhost/auth/register/ and click "Register Account"
* Without this patch, get an error `#1062: Duplicate entry 'PHID-FILE-foobar' for key 'originalPHID'`
Also, to be sure:
* Visit your {nav profile > Manage > Edit Settings > External Accounts} and Unlink your GitHub profile (with the "x" icon)
* From the same page {nav Link External Account} to link GitHub again and confirm: it still works
Reviewers: O1 Blessed Committers, avivey, aklapper
Reviewed By: O1 Blessed Committers, avivey, aklapper
Subscribers: avivey, ajhalili2006, #affects_filed_by_subscribed_by_recap_time_squad, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Tags: #auth, #affects_filed_by_subscribed_by_recap_time_squad
Maniphest Tasks: T16527, T16528, T16532
Differential Revision: https://we.phorge.it/D26803
authored by