style(auth): remove debug border from AuthPanel, clean up console.log
This commit is contained in:
@@ -4,11 +4,7 @@ import DmButton from './DmButton.astro';
|
|||||||
const user = Astro.locals.user;
|
const user = Astro.locals.user;
|
||||||
---
|
---
|
||||||
|
|
||||||
<!-- DEBUG: user={JSON.stringify(user)} -->
|
{!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"
|
||||||
@@ -27,7 +23,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
|
||||||
@@ -51,14 +47,4 @@ const user = Astro.locals.user;
|
|||||||
Выйти
|
Выйти
|
||||||
</DmButton>
|
</DmButton>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
(function () {
|
|
||||||
const el = document.querySelector('[data-auth-state]');
|
|
||||||
const state = el?.getAttribute('data-auth-state');
|
|
||||||
const userName = el?.getAttribute('data-user-name');
|
|
||||||
console.log('[AuthPanel] Client auth state:', state, userName ? { userName } : '');
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user