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:
@@ -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';
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user