Connect accounts when logging in via email
This commit is contained in:
parent
7ac6aadf32
commit
35c7aaaa24
@ -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()
|
||||
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user