Added support for email login #1513

This commit is contained in:
tidusjar 2017-10-01 21:26:03 +01:00
commit 18be4a89f7
2 changed files with 8 additions and 2 deletions

View file

@ -28,7 +28,7 @@
<li id="UserManagement" [routerLinkActive]="['active']"><a [routerLink]="['/usermanagement']"><i class="fa fa-user"></i> User Management</a></li>
</ul>
<ul *ngIf="hasRole('Admin') || hasRole('PowerUser')" class="nav navbar-nav">
<li><a href="https://www.paypal.me/PlexRequestsNet" target="_blank" pTooltip="This is how I convince my wife to let me spend my spare time on Ombi ;)"><i class="fa fa-heart" style="color:red"></i> Donate!</a></li>
<li><a href="https://www.paypal.me/PlexRequestsNet" target="_blank" pTooltip="This is how I convince my wife to let me spend my spare time developing Ombi ;)"><i class="fa fa-heart" style="color:red"></i> Donate!</a></li>
</ul>

View file

@ -51,10 +51,16 @@ namespace Ombi.Controllers
var user = await _userManager.FindByNameAsync(model.Username);
if (user == null)
{
// Could this be an email login?
user = await _userManager.FindByEmailAsync(model.Username);
if (user == null)
{
return new UnauthorizedResult();
}
}
// Verify Password
if (await _userManager.CheckPasswordAsync(user, model.Password))