Have the live page determine if they're logged in and prevent the form until they do.
This commit is contained in:
parent
fcb71add03
commit
609ca7b363
1 changed files with 25 additions and 13 deletions
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue