django-whoop demo

{% if messages %} {% endif %} {% if connection and connection.status == 'active' %}
WHOOP connected
WHOOP user ID: {{ connection.whoop_user_id }}
Status: {{ connection.status }} · Token: {% if connection.is_token_expired %}expired{% else %}valid{% endif %} (expires {{ connection.token_expires_at }}) · Last sync: {{ connection.last_sync_at|default:"never" }}
{% csrf_token %}
{% if connection.is_token_expired %}
Access token expired.
A sync will try to refresh it (WHOOP rotates the refresh token on every refresh); if the refresh fails with invalid_grant, re-authorize to mint a new pair.
Re-authorize
{% endif %}
{{ record_count }} record(s) · {{ workout_count }} workout(s) in healthdatamodel
Browse records
Re-authorize
{% csrf_token %}
{% else %}
{% if connection %} WHOOP {{ connection.status }}.
This connection can no longer sync. Re-authorize to resume. {% else %} Not connected to WHOOP.
You'll be sent to WHOOP for consent, then back here. {% endif %}
{% if connection %}Re-authorize{% else %}Connect WHOOP{% endif %}
{% endif %}