Пример #1
0
 public bool Login(AdminLoginModel model)
 {
     if (model.Username.ToLower() == Settings.UserName.ToLower() && model.Password == Settings.Password)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Пример #2
0
        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));
            }
        }