fix: admin logout clears only admin tokens + add signup token tests

- Fix admin header.html logout to not use localStorage.clear()
  which was clearing vendor/customer tokens too
- Add tests for signup access_token generation
- Test that token is returned in response
- Test that token can authenticate API calls
- Test that vendor_token cookie is set

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-28 18:18:23 +01:00
parent 4298af9f79
commit 81e5cb41d6
2 changed files with 126 additions and 2 deletions

View File

@@ -284,8 +284,10 @@ document.addEventListener('alpine:init', () => {
console.error('Logout API error (continuing anyway):', error);
})
.finally(() => {
// Clear all tokens
localStorage.clear();
// Clear admin tokens only (not vendor or customer tokens)
localStorage.removeItem('admin_token');
localStorage.removeItem('admin_user');
// Note: Do NOT use localStorage.clear() - it would clear vendor/customer tokens too
window.location.href = '/admin/login';
});
}