Skip to content

Commit

Permalink
use settings action uri from flow model
Browse files Browse the repository at this point in the history
  • Loading branch information
josxha committed Nov 3, 2023
1 parent 5647177 commit d0a63f6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions KratosSelfService/Controllers/SettingsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public async Task<IActionResult> Settings(
// create new flow
logger.LogDebug("Exception while retrieving settings flow: {Message}", exception.Message);
var newFlow = await api.Frontend
.CreateBrowserSettingsFlowAsync(cookie: Request.Headers.Cookie, returnTo:returnTo);
.CreateBrowserSettingsFlowAsync(cookie: Request.Headers.Cookie, returnTo: returnTo);
return Redirect($"settings?flow={newFlow.Id}");
}

var model = new SettingsModel(flow, api.GetSettingsUrl(flow.Id));
var model = new SettingsModel(flow);
return View("Settings", model);
}
}
6 changes: 0 additions & 6 deletions KratosSelfService/Services/ApiService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,4 @@ public string GetUrlForBrowserFlow(string flow, Dictionary<string, string?>? que
var baseUrl = env.KratosBrowserUrl ?? env.KratosPublicUrl;
return $"{baseUrl.RemoveTrailingSlash()}/self-service/{flow}/browser?{queryString}";
}

public string GetSettingsUrl(string flowId)
{
var baseUrl = env.KratosBrowserUrl ?? env.KratosPublicUrl;
return $"{baseUrl.RemoveTrailingSlash()}/self-service/settings?flow={flowId}";
}
}
2 changes: 1 addition & 1 deletion KratosSelfService/Views/Settings/Settings.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<h3 class="subtitle">
@group.Key.ToLocalTitleString(OryTranslator)
</h3>
<form class="mb-3" action="@Model.postUri" method="@Model.flow.Ui.Method">
<form class="mb-3" action="@Model.flow.Ui.Action" method="@Model.flow.Ui.Method">
@foreach (var node in defaultNodes)
{
var model = new KratosUiNodeModel(node, FlowType.Settings);
Expand Down

0 comments on commit d0a63f6

Please sign in to comment.