Update layout to include access management and adjust input type for PIN authentication

- Added hasAccess property to layout server load for improved access control.
- Updated layout to check for hasAccess instead of authenticated for rendering the LogoutButton.
- Changed input type for access PIN from password to tel for better user experience and input handling.
This commit is contained in:
taogaetz 2025-09-14 15:10:10 -04:00
parent fe3f532a25
commit 1fc17a8039
3 changed files with 6 additions and 3 deletions

View File

@ -21,6 +21,7 @@ export const load: LayoutServerLoad = async ({ locals }) => {
return { return {
recipes, recipes,
authenticated: locals.authenticated authenticated: locals.authenticated,
hasAccess: locals.hasAccess
}; };
}; };

View File

@ -47,7 +47,7 @@
© 2025 Birbante - Italian Apericena & Dolce Vita © 2025 Birbante - Italian Apericena & Dolce Vita
</div> </div>
<div class="flex items-center gap-4"> <div class="flex items-center gap-4">
{#if data.authenticated} {#if data.hasAccess}
<LogoutButton /> <LogoutButton />
{/if} {/if}
</div> </div>

View File

@ -23,7 +23,9 @@
<span class="label-text">Access Code</span> <span class="label-text">Access Code</span>
</label> </label>
<input <input
type="password" type="tel"
inputmode="numeric"
pattern="[0-9]*"
id="pin" id="pin"
name="pin" name="pin"
class="input-bordered input w-full" class="input-bordered input w-full"