basic account creation flow created
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
{{- $loggedIn := and (and .Identity .Identity.AccessToken) true -}}
|
||||
{{- $hasAccount := and (and .Identity .Identity.Account) true -}}
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="min-h-full flex flex-col items-stretch">
|
||||
<head>
|
||||
@@ -36,7 +40,7 @@
|
||||
hx-boost="true"
|
||||
|
||||
{{/* subscribe to sse (if logged in) */}}
|
||||
{{- if and .Identity .Identity.AccessToken }}
|
||||
{{- if and $loggedIn $hasAccount }}
|
||||
sse-connect="/api/events/"
|
||||
sse-close="close"
|
||||
{{- end }}
|
||||
@@ -69,29 +73,16 @@
|
||||
style="
|
||||
"
|
||||
>
|
||||
<li class="pt-[1em] pb-[1em]">
|
||||
<a href="/ui" class="p-[1em] font-display {{ if eq $path "/" }}selected{{ end }}">
|
||||
Home
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{{/* */}}
|
||||
{{- $userID := .Identity.User.UserID }}
|
||||
{{- $acct := .Identity.Account }}
|
||||
{{- $acctID := 0 }}
|
||||
{{- if $acct }}
|
||||
{{- $acctID = $acct.AccountID }}
|
||||
{{- end }}
|
||||
|
||||
{{- if not $userID }}
|
||||
{{- if not $loggedIn }}
|
||||
|
||||
<li class="pt-[1em] pb-[1em]">
|
||||
<a href="/api/auth/login" hx-boost="false" class="p-[1em] font-display {{ if eq $path "/auth/login" }}selected{{ end }}">
|
||||
Log In / Sign Up
|
||||
Log In
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{{- else if $acctID }}
|
||||
{{- else if $hasAccount }}
|
||||
{{- $acctID := .Identity.Account.AccountID }}
|
||||
|
||||
<li class="pt-[1em] pb-[1em]">
|
||||
<a href="/ui/accounts/{{$acctID}}" class="p-[1em] font-display {{ if eq $path (printf "/accounts/%d" $acctID) }}selected{{ end }}">
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
{{- $loggedIn := and (and .Identity .Identity.AccessToken) true -}}
|
||||
|
||||
|
||||
<section class="flex justify-center max-w-full mt-[3em] mb-[3em]">
|
||||
<h1 class="
|
||||
min-[400px]:px-[calc(10vw-0.5em)]
|
||||
@@ -12,20 +15,21 @@
|
||||
|
||||
</section>
|
||||
|
||||
{{- if and .Identity.User.UserID (not .Identity.Account) }}
|
||||
{{/* TODO: make account creation automatic as part of the user creation process */}}
|
||||
<h2><a href="/ui/account-creation">New Account</a></h2>
|
||||
{{- end }}
|
||||
|
||||
<section class="flex flex-col items-center max-w-full mt-[1em] mb-[1em] gap-y-[2em]">
|
||||
<p class="text-lg text-center max-w-[50%]">
|
||||
Synchronize inventory automatically!
|
||||
</p>
|
||||
|
||||
<div class="border-button border-sidebar-border bg-card text-lg text-center max-w-[50%]">
|
||||
<a href="/api/auth/login" hx-boost="false" class="block p-[1em] font-bold">
|
||||
Create an Account
|
||||
</a>
|
||||
{{- if $loggedIn }}
|
||||
<a hx-post="/api/accounts" hx-target="body" class="block p-[1em] font-bold">
|
||||
Create an Account
|
||||
</a>
|
||||
{{- else }}
|
||||
<a href="/api/auth/login" hx-boost="false" class="block p-[1em] font-bold">
|
||||
New Login
|
||||
</a>
|
||||
{{- end }}
|
||||
</div>
|
||||
|
||||
<p class="text-lg text-center max-w-[50%]">
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<section class="text-center">
|
||||
<header class="m-[1em]">
|
||||
<h2>
|
||||
Access Not Granted
|
||||
</h2>
|
||||
|
||||
{{ $link := printf "/ui%s" .Request.URL }}
|
||||
<a href="{{ $link }}" class="block m-[1em]">
|
||||
<code>
|
||||
{{ $link }}
|
||||
</code>
|
||||
</a>
|
||||
</header>
|
||||
|
||||
<div class="m-[2em]">
|
||||
<p class="italic font-bold">
|
||||
Sorry, you don't have access to the page you were looking for.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user