Ejemplo n.º 1
0
        public void SignIn()
        {
            SessionLogic.SignUp(User());
            User user = SessionLogic.SignIn(User().Email, User().Password);

            Assert.AreEqual(user.Email, User().Email);
        }
 public IActionResult PostSignIn([FromBody] SignInModel credentials)
 {
     try
     {
         User user  = Sessions.SignIn(credentials.Email, credentials.Password);
         var  token = GenerateJSONWebToken(user);
         return(Json(new
         {
             uid = user.Email,
             token
         }));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }