public async Task <IActionResult> GetAuthCode(CodeChallengeRequest request) { if (!string.IsNullOrEmpty(request?.CodeChallenge)) { var code = await authCodeService.GenerateAuthCodeAndSaveAsync(request.CodeChallenge); return(new JsonResult(new CodeAnswer { Code = code })); } return(BadRequest()); }