Пример #1
0
        public async Task <IActionResult> Login([FromBody] UserLoginDto model)
        {
            if (!await _identityManager.ValidateUser(model.Email, model.Password))
            {
                _logger.LogWarn($"{nameof(Post)}: Login failed. Wrong user name or password.");

                return(Unauthorized());
            }

            return(Ok(
                       new { Token = await _identityManager.CreateToken() }
                       ));
        }