debug(auth): add visible debug border and user state to AuthPanel
This commit is contained in:
@@ -4,7 +4,11 @@ import DmButton from './DmButton.astro';
|
||||
const user = Astro.locals.user;
|
||||
---
|
||||
|
||||
{!user ? (
|
||||
<!-- DEBUG: user={JSON.stringify(user)} -->
|
||||
<div class="border border-dashed border-[var(--accent)] rounded-lg p-2 min-w-[200px]">
|
||||
<div class="text-xs text-[var(--accent)] mb-1 font-mono">AuthPanel: {user ? 'logged-in' : 'logged-out'}</div>
|
||||
|
||||
{!user ? (
|
||||
<div class="flex flex-col sm:flex-row gap-3" data-auth-state="logged-out">
|
||||
<DmButton
|
||||
href="/api/auth/login/vk"
|
||||
@@ -23,7 +27,7 @@ const user = Astro.locals.user;
|
||||
Войти через Яндекс
|
||||
</DmButton>
|
||||
</div>
|
||||
) : (
|
||||
) : (
|
||||
<div class="flex items-center gap-3 flex-wrap" data-auth-state="logged-in" data-user-name={user.name}>
|
||||
{user.avatar ? (
|
||||
<img
|
||||
@@ -47,7 +51,8 @@ const user = Astro.locals.user;
|
||||
Выйти
|
||||
</DmButton>
|
||||
</div>
|
||||
)}
|
||||
)}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
|
||||
Reference in New Issue
Block a user