Files
AudioBookRequest/templates/init.html

41 lines
2.0 KiB
HTML

<!-- Admin initialization page -->
{% extends "base.html" %}
{% block head %}
<title>Initialize admin user</title>
{% endblock head %}
{% block body %}
<div class="h-screen w-full flex items-center justify-center">
<form class="flex flex-col gap-2 max-w-[30rem]" hx-post="{{ base_url }}/init" id="form" hx-target="#message">
<p class="opacity-60">
No user was found in the database. Please create a root admin user to get set
up. OpenID Connect can be configured later.
</p>
<label for="login-type">Login Type</label>
<select id="login-type" name="login_type" class="select w-full" {% if force_login_type %}disabled{% endif %}>
<option value="basic" {% if force_login_type and force_login_type.is_basic() %}selected{% endif %}>Basic Auth
(Dialog)</option>
<option value="forms" {% if not force_login_type or force_login_type.is_forms() %}selected{% endif %}>Forms Login
</option>;
<option value="none" {% if force_login_type and force_login_type.is_none() %}selected{% endif %}>None (Insecure)
</option>
</select>
{% if force_login_type %}
<p class="text-xs opacity-60">Login type is forced by the environment variable
<code>ABR_APP__FORCE_LOGIN_TYPE</code>.
</p>
<input type="hidden" name="login_type" value="{{ force_login_type.value }}" />
{% endif %}
<label for="username">Username</label>
<input id="username" name="username" type="text" class="input w-full" minlength="1" required />
<label for="password">Password</label>
<input id="password" name="password" type="password" class="input w-full" required />
<label for="confirm_password">Confirm password</label>
<input id="confirm_password" name="confirm_password" type="password" class="input w-full" required />
{% block init_messages %}
<span id="message" class="text-red-400">{{ error }}</span>
{% endblock init_messages %}
<button id="submit" class="btn btn-primary" type="submit">Create account</button>
</form>
</div>
{% endblock body %}