Connect accounts when logging in via email

This commit is contained in:
Eduard Urbach 2019-03-05 15:26:48 +09:00
parent 7ac6aadf32
commit 35c7aaaa24
3 changed files with 9 additions and 0 deletions

View File

@ -121,6 +121,9 @@ func InstallFacebookAuth(app *aero.Application) {
if getErr == nil && user != nil {
authLog.Info("User logged in via Facebook ID", user.ID, user.Nick, ctx.RealIP(), user.Email, user.RealName())
// Add FacebookToUser reference
user.ConnectFacebook(fbUser.ID)
user.LastLogin = arn.DateTimeUTC()
user.Save()

View File

@ -145,6 +145,9 @@ func InstallGoogleAuth(app *aero.Application) {
if getErr == nil && user != nil {
authLog.Info("User logged in via Email", user.ID, user.Nick, ctx.RealIP(), user.Email, user.RealName())
// Add GoogleToUser reference
user.ConnectGoogle(googleUser.Sub)
user.LastLogin = arn.DateTimeUTC()
user.Save()

View File

@ -142,6 +142,9 @@ func InstallTwitterAuth(app *aero.Application) {
if getErr == nil && user != nil {
authLog.Info("User logged in via Email", user.ID, user.Nick, ctx.RealIP(), user.Email, user.RealName())
// Add TwitterToUser reference
user.ConnectTwitter(twUser.ID)
user.LastLogin = arn.DateTimeUTC()
user.Save()