Use the email address when looking for existing Google Account records

If Gerrit is aliased under multiple DNS names and/or HTTP ports we may
have asked Google Accounts to generate us different OpenID strings for
the same user identity.  By looking for an existing Google Account key
using the email address we can avoid creating a duplicate account for
the user if they login to the same database, but through a CNAME alias.

Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2008-12-31 09:16:28 -08:00
parent eb76024bd4
commit 00d7a99e3e
3 changed files with 20 additions and 2 deletions

View File

@@ -30,4 +30,7 @@ public interface AccountExternalIdAccess extends
@Query("WHERE key.accountId = ?")
ResultSet<AccountExternalId> byAccount(Account.Id id) throws OrmException;
@Query("WHERE emailAddress = ?")
ResultSet<AccountExternalId> byEmailAddress(String email) throws OrmException;
}