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;
|
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">
|
<div class="flex flex-col sm:flex-row gap-3" data-auth-state="logged-out">
|
||||||
<DmButton
|
<DmButton
|
||||||
href="/api/auth/login/vk"
|
href="/api/auth/login/vk"
|
||||||
@@ -23,7 +27,7 @@ const user = Astro.locals.user;
|
|||||||
Войти через Яндекс
|
Войти через Яндекс
|
||||||
</DmButton>
|
</DmButton>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div class="flex items-center gap-3 flex-wrap" data-auth-state="logged-in" data-user-name={user.name}>
|
<div class="flex items-center gap-3 flex-wrap" data-auth-state="logged-in" data-user-name={user.name}>
|
||||||
{user.avatar ? (
|
{user.avatar ? (
|
||||||
<img
|
<img
|
||||||
@@ -47,7 +51,8 @@ const user = Astro.locals.user;
|
|||||||
Выйти
|
Выйти
|
||||||
</DmButton>
|
</DmButton>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
(function () {
|
(function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user