Connect accounts when logging in via email

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

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()