Ejemplo n.º 1
0
        public async Task <IActionResult> Login([FromBody] VkLoginModel model)
        {
            if (string.IsNullOrEmpty(model.Email))
            {
                return(BadRequest("Email is missing"));
            }

            if (string.IsNullOrEmpty(model.Token))
            {
                return(BadRequest("Token is missing"));
            }

            if (string.IsNullOrEmpty(model.UserId))
            {
                return(BadRequest("UserId is missing"));
            }

            if (string.IsNullOrEmpty(model.UserName))
            {
                return(BadRequest("UserName is missing"));
            }

            var res =
                await _vkService.Login(model, Request.Headers.FirstOrDefault(x => x.Key == "X-Real-IP").Value);

            return(Ok(res));
        }
Ejemplo n.º 2
0
 void VKLogin()
 {
     _vkService.Login(OnLoginComplete);
 }