[Notice] Announcing the End of Demo Server [Read me]
social-login: Add fallback with ignore cases email search
@90dc6239790600e2297062d164f06fb6c86da766
--- app/models/User.java
+++ app/models/User.java
... | ... | @@ -320,6 +320,11 @@ |
320 | 320 |
return subEmail.user; |
321 | 321 |
} |
322 | 322 |
|
323 |
+ User fallback = find.where().ieq("email", email).findUnique(); |
|
324 |
+ if (fallback != null) { |
|
325 |
+ return fallback; |
|
326 |
+ } |
|
327 |
+ |
|
323 | 328 |
User anonymous = new NullUser(); |
324 | 329 |
anonymous.email = email; |
325 | 330 |
return anonymous; |
--- app/service/YonaUserServicePlugin.java
+++ app/service/YonaUserServicePlugin.java
... | ... | @@ -66,7 +66,7 @@ |
66 | 66 |
User localUser = User.findByEmail(authUser.getEmail()); //find with oAuth email address |
67 | 67 |
if(localUser.isAnonymous()){ |
68 | 68 |
localUser = User.findByEmail(u.email); // 1st trial: same email address with local user credential |
69 |
- if(localUser == null) localUser = User.find.byId(u.user.id); // 2nd trial: linked user |
|
69 |
+ if(localUser == null || localUser.isAnonymous()) localUser = User.find.byId(u.user.id); // 2nd trial: linked user |
|
70 | 70 |
if(localUser == null) localUser = User.anonymous; |
71 | 71 |
} |
72 | 72 |
|
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?