Compare commits

..

No commits in common. "8315f737d455e4dbecbcdd9ccab2893c63e40734" and "6d25faa633af2db7b705ef93a6ced3214a66dcc5" have entirely different histories.

2 changed files with 4 additions and 9 deletions

View file

@ -51,7 +51,7 @@ Feature: Signup and login
Then the login request should have been made
And I should see "Email ou mot de passe incorrect"
Scenario: Logging out returns to the landing page
Scenario: Logging out returns to the login page
Given I am signed in as "Alice" "Martin"
And my household id is 1
And the planning request returns nothing
@ -60,4 +60,4 @@ Feature: Signup and login
And I open the account menu
And I click the button "Se déconnecter"
Then the logout request should have been made
And the URL should be the home page
And the URL should include "/login"

View file

@ -201,17 +201,12 @@ function AccountMenu() {
const { t } = useTranslation();
const [isOpen, setIsOpen] = useState(false);
/**
* Ends the session and returns to `/` — `RequireAuth` shows the public
* {@link LandingPage} there for a logged-out visitor (issue #41), so this
* naturally lands on the marketing page rather than straight back at the
* login form.
*/
/** Ends the session and returns to the login page. */
async function handleLogout() {
setIsOpen(false);
try {
await logout();
void navigate("/");
void navigate("/login");
} catch (err) {
// Rethrown as-is — `AuthContext`'s `logout` already documents itself
// as throwing `ApiError` on failure; this handler just isn't allowed