generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
Hello,
I am using a code that looks like:
logout(): void {
console.log('🚪 Logging out...');
localStorage.clear();
this.resetCircuitBreaker();
this.updateAuthState({
isAuthenticated: false,
user: null,
isProcessing: false,
error: null
});
// AWS Cognito logout + redirect to login page
const clientId = '12312312';
const currentUrl = window.location.href;
const redirectUri = encodeURIComponent(
currentUrl.includes('localhost:4200')
? 'http://localhost:4200'
: 'https://website.ai'
);
// Use redirect_uri (not logout_uri) to show login page after logout
const logoutUrl = `https://website.us-east-2.amazoncognito.com/logout?client_id=${clientId}&redirect_uri=${redirectUri}&response_type=code&scope=openid`;
console.log('🔗 Logout URL:', logoutUrl);
// Redirect to logout (will show login page)
window.location.href = logoutUrl;
}
it takes me to a login page of cognito, but when I signed in I am still signed in as another user, which means it didn't log me out in the first place. What am I doing wrong? How can I fix this issue?
Metadata
Metadata
Assignees
Labels
No labels