feat: handle Garmin MFA and activity retries
This commit is contained in:
5
app/web/templates/fragments/mfa_form.html
Normal file
5
app/web/templates/fragments/mfa_form.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<form method="post" action="/users/{{ user.id }}/garmin-mfa">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<label>Garmin MFA code: <input type="text" name="code" maxlength="20" required></label>
|
||||
<button type="submit">Submit code</button>
|
||||
</form>
|
||||
@@ -28,4 +28,26 @@
|
||||
<dt>Updated at</dt>
|
||||
<dd>{{ user.updated_at }}</dd>
|
||||
</dl>
|
||||
|
||||
{% if user.action_reason == "garmin_mfa_required" %}
|
||||
<h2>Garmin MFA required</h2>
|
||||
{% include "fragments/mfa_form.html" %}
|
||||
{% endif %}
|
||||
|
||||
<h2>Activities</h2>
|
||||
<ul>
|
||||
{% for activity in activities %}
|
||||
<li>
|
||||
{{ activity.activity_name }} — {{ activity.status.value }}
|
||||
{% if activity.status.value == "failed" and activity.retryable %}
|
||||
<form method="post" action="/activities/{{ activity.id }}/retry" style="display:inline">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<button type="submit">Retry</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% else %}
|
||||
<li>No pending activities.</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user