예제 #1
0
 public IHttpActionResult PostSignIn([FromBody] SignInPIN request)
 {
     try
     {
         var decode = Securities.Decode <User>(request.TempData);
         if (decode != null)
         {
             var res = _Authen.login((int)decode.username, request.PIN);
             if (res != null)
             {
                 return(Json(new { Token = Authentication.Authentication.SetAuthenticated(res), Detail = res }));
             }
             return(BadRequest("PIN incorrent"));
         }
         return(BadRequest("Model incorrent"));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }