✨(frontend) add logout button
Rework the header based on latest Johann's design, which introduced a dropdown menu to manage user account. In this menu, you can find a logout button, which ends up the backend session by calling the logout endpoint. Please that automatic redirection when receiving the backend response were disabled. We handle it in our custom hook, which reload the page. Has the session cookie have been cleared, on reloading the page, a new loggin flow is initiated, and the user is redirected to the OIDC provider.
This commit is contained in:
@@ -64,4 +64,20 @@ test.describe('Header', () => {
|
||||
|
||||
await expect(page.getByRole('link', { name: 'Grist' })).toBeVisible();
|
||||
});
|
||||
|
||||
test('checks logout button', async ({ page }) => {
|
||||
await page
|
||||
.getByRole('button', {
|
||||
name: 'My account',
|
||||
})
|
||||
.click();
|
||||
|
||||
await page
|
||||
.getByRole('button', {
|
||||
name: 'Logout',
|
||||
})
|
||||
.click();
|
||||
|
||||
await expect(page.getByRole('button', { name: 'Sign in' })).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user