Skip to content

Commit fbe43e3

Browse files
committed
fix: also match by email in Accounts.register_github_user
1 parent 1745cea commit fbe43e3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/algora/accounts/accounts.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ defmodule Algora.Accounts do
254254
from(u in User,
255255
left_join: i in Identity,
256256
on: i.provider == "github" and i.provider_id == ^to_string(info["id"]),
257-
where: u.provider == "github" and u.provider_id == ^to_string(info["id"]),
257+
where:
258+
(u.provider == "github" and u.provider_id == ^to_string(info["id"])) or
259+
u.email == ^primary_email,
258260
select: {u, i}
259261
)
260262

0 commit comments

Comments
 (0)