Have the live page determine if they're logged in and prevent the form until they do.

This commit is contained in:
Zed A. Shaw 2025-09-17 11:38:48 -04:00
parent fcb71add03
commit 609ca7b363

View file

@ -23,6 +23,10 @@
</table>
</div>
<div class="flex flex-col"
x-data="{auth: false}"
x-init="auth = await GetJson('/api/authcheck')">
<template x-if="auth.is_authed">
<form action="/api/link" method="POST">
<card class="card">
<top>Submit a Link</top>
@ -36,6 +40,14 @@
</bottom>
</card>
</form>
</template>
<template x-if="!auth.is_authed">
<aside>
<p><mark>Post Links</mark> You can post links after you <a href="/login/">Login</a>. If you want an account simply <a href="/register/">Register</a>.</p>
</aside>
</template>
</div>
</bar>
</div>