Fixes the Google login

This commit is contained in:
2020-06-01 01:20:04 +01:00
parent cc6a6b8425
commit b4fbe13843
7 changed files with 18 additions and 20 deletions

View File

@ -94,10 +94,11 @@ namespace Yavsc.Controllers
// user.EmailConfirmed
return View(toShow.ToArray());
}
string GeneratePageToken() {
return System.Guid.NewGuid().ToString();
}
[AllowAnonymous]
[HttpGet(Constants.LoginPath)]
public ActionResult SignIn(string returnUrl = null)
@ -152,7 +153,11 @@ namespace Yavsc.Controllers
return this.ViewOk(model);
}
}
else {
ModelState.AddModelError(string.Empty,
"No such user.");
return this.ViewOk(model);
}
// This doesn't count login failures towards account lockout
// To enable password failures to trigger account lockout, set lockoutOnFailure: true
var result = await _signInManager.PasswordSignInAsync(model.UserName, model.Password, model.RememberMe, lockoutOnFailure: false);

View File

@ -22,13 +22,15 @@ namespace Yavsc.Controllers
IStringLocalizer<Yavsc.YavscLocalisation> _localizer;
IStringLocalizer<BugController> _bugLocalizer;
public ProjectController(ApplicationDbContext context,
public ProjectController(ApplicationDbContext context,
ILoggerFactory loggerFactory,
IStringLocalizer<Yavsc.YavscLocalisation> localizer
IStringLocalizer<Yavsc.YavscLocalisation> localizer,
IStringLocalizer<BugController> bugLocalizer
)
{
_context = context;
_localizer = localizer;
_bugLocalizer = bugLocalizer;
_logger = loggerFactory.CreateLogger<ProjectController>();
}
@ -36,6 +38,7 @@ namespace Yavsc.Controllers
// GET: Project
public async Task<IActionResult> Index()
{
var applicationDbContext = _context.Project.Include(p => p.Client).Include(p => p.Context).Include(p => p.PerformerProfile).Include(p => p.Regularisation).Include(p => p.Repository);
return View(await applicationDbContext.ToListAsync());
}