Browse Source

Added checking of email/git accounts and re-adding them if they do not exist. (All for one, and one for all)

tags/2.0.3
Teknikode 4 years ago
parent
commit
3d5e2a359d
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      Teknik/Areas/User/Controllers/UserController.cs

+ 12
- 0
Teknik/Areas/User/Controllers/UserController.cs View File

@@ -170,6 +170,18 @@ namespace Teknik.Areas.Users.Controllers
db.Entry(user).State = EntityState.Modified;
db.SaveChanges();

// Let's double check their email and git accounts to make sure they exist
string email = UserHelper.GetUserEmailAddress(Config, username);
if (Config.EmailConfig.Enabled && !UserHelper.UserEmailExists(Config, email))
{
UserHelper.AddUserEmail(Config, email, model.Password);
}

if (Config.GitConfig.Enabled && !UserHelper.UserGitExists(Config, username))
{
UserHelper.AddUserGit(Config, username, model.Password);
}

bool twoFactor = false;
string returnUrl = model.ReturnUrl;
if (user.SecuritySettings.TwoFactorEnabled)

Loading…
Cancel
Save