public bool Login(AdminLoginModel model) { if (model.Username.ToLower() == Settings.UserName.ToLower() && model.Password == Settings.Password) { return(true); } else { return(false); } }
public async Task <IHttpActionResult> post(AdminLoginModel model) { if (!_loginService.Login(model)) { return(new ContentErrorResult(Request, HttpStatusCode.Forbidden, "Invalid Login Attempt")); } else { var profile = await _loginService.GetProfileAsync(); return(Ok(profile)); } }