frontend: Janky code to make redirects after login work

This commit is contained in:
Lennart
2025-04-13 19:55:48 +02:00
parent 14e5533b6f
commit 64233f91d2
7 changed files with 89 additions and 21 deletions

View File

@@ -4,6 +4,9 @@
<div class="login_window">
<h1>Login</h1>
{% if let Some(redirect_uri) = redirect_uri %}
<p>and redirect to {{redirect_uri}}</p>
{% endif %}
<form action="login" method="post" id="form_login">
<label for="username">Username</label>
<input type="text" id="username" name="username" placeholder="username">
@@ -11,11 +14,19 @@
<label for="password">Password</label>
<input type="password" id="password" name="password" placeholder="password">
<br>
{% if let Some(redirect_uri) = redirect_uri %}
<input type="hidden" name="redirect_uri" value="{{ redirect_uri }}">
{% endif %}
<button type="submit">Login</button>
</form>
{% if let Some(OidcProviderData {name, redirect_url}) = oidc_data %}
<a href="{{ redirect_url }}">Login with {{ name }}</a>
<form action="{{ redirect_url }}" method="post" id="form_login">
{% if let Some(redirect_uri) = redirect_uri %}
<input type="hidden" name="redirect_uri" value="{{ redirect_uri }}">
{% endif %}
<button type="submit">Login with {{ name }}</button>
</form>
{% endif %}
</div>