mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-08 14:10:50 -07:00
Started the user auth
This commit is contained in:
parent
48fd182e52
commit
a8b6137ef8
9 changed files with 115 additions and 22 deletions
|
@ -28,12 +28,11 @@ namespace RequestPlex.UI.Modules
|
|||
|
||||
Post["/login"] = x =>
|
||||
{
|
||||
|
||||
var userId = UserMapper.ValidateUser((string)this.Request.Form.Username, (string)this.Request.Form.Password);
|
||||
var userId = UserMapper.ValidateUser((string)Request.Form.Username, (string)Request.Form.Password);
|
||||
|
||||
if (userId == null)
|
||||
{
|
||||
return this.Context.GetRedirect("~/login?error=true&username=" + (string)this.Request.Form.Username);
|
||||
return Context.GetRedirect("~/login?error=true&username=" + (string)Request.Form.Username);
|
||||
}
|
||||
DateTime? expiry = null;
|
||||
if (Request.Form.RememberMe.HasValue)
|
||||
|
@ -63,8 +62,6 @@ namespace RequestPlex.UI.Modules
|
|||
var userId = UserMapper.CreateUser(Request.Form.Username, Request.Form.Password);
|
||||
return this.LoginAndRedirect((Guid)userId);
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue