Пример #1
0
        public IActionResult Register([FromBody] User user)
        {
            try
            {
                using (var db = new PeerDb())
                {
                    db.Insert(new BO.User(user));
                }
            }
            catch (Exception e)
            {
                return BadRequest($"{e.Message}");
            }

            var jwtSecurity = new JwtSecurity.JwtSecurity();
            return Ok(jwtSecurity.Login(user));
        }
Пример #2
0
 public IActionResult Token([FromBody] User user)
 {
     var jwtSecurity = new JwtSecurity.JwtSecurity();
     return Ok(jwtSecurity.Login(user));
 }