Skip to content

Commit

Permalink
fix: login flow without login_challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
josxha committed Dec 29, 2023
1 parent de1a812 commit ecfef45
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions KratosSelfService/Controllers/LoginController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,16 @@ public async Task<IActionResult> Login(
private string GetInitFlowUrl(string? aal, string? refresh, string? returnTo, string? organization,
string? loginChallenge)
{
return api.GetUrlForBrowserFlow("login", new Dictionary<string, string?>
var query = new Dictionary<string, string?>
{
["aal"] = aal ?? "",
["refresh"] = refresh ?? "",
["return_to"] = returnTo ?? "",
["organization"] = organization ?? "",
["login_challenge"] = loginChallenge ?? ""
});
["organization"] = organization ?? ""
};
if (!string.IsNullOrWhiteSpace(loginChallenge)) query["login_challenge"] = loginChallenge;

return api.GetUrlForBrowserFlow("login", query);
}

private async Task<IActionResult> RedirectToVerificationFlow(KratosLoginFlow flow)
Expand Down

0 comments on commit ecfef45

Please sign in to comment.