Started the user auth

This commit is contained in:
tidusjar 2016-03-02 15:18:06 +00:00
parent 48fd182e52
commit a8b6137ef8
9 changed files with 115 additions and 22 deletions

View file

@ -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);
};
}
}
}