public string GetRandomToken() { var jwt = new JwtServices(_config); var token = jwt.GenerateSecurityToken("*****@*****.**"); return(token); }
public string GetRandomToken(string email) { var jwt = new JwtServices(_config); var token = jwt.GenerateSecurityToken(email); return(token); }
public IActionResult Login(LoginVM login) { var result = _accountRepository.Login(login); if (result != null) { var jwt = new JwtServices(_configuration); var token = jwt.GenerateSecurityToken(result); return(Ok(new { Message = "You have successfully Sign In", result, Token = token })); } else { return(new OkObjectResult(new { Status = HttpStatusCode.Unauthorized, ErrorMessage = "Unauthorized Access" })); } }