Fix auth verification flow and alert ID fallback

This commit is contained in:
2026-04-06 17:07:14 +02:00
parent 1521602743
commit a0da39b697
4 changed files with 56 additions and 23 deletions
+7 -4
View File
@@ -46,14 +46,14 @@ export async function restoreSession(store) {
}
try {
await verifyConnection(store);
return await verifyConnection(store);
} catch (error) {
if (!isAuthFailure(error)) {
throw error;
}
}
return store.session;
return { session: store.session, kitchens: [] };
}
export async function logout(store) {
@@ -80,13 +80,16 @@ export async function verifyConnection(store) {
}
try {
await listKitchens(store);
const kitchens = await listKitchens(store);
store.setSession({
...store.session,
state: CONNECTION_STATES.connected,
hasValidated: true,
});
return store.session;
return {
session: store.session,
kitchens,
};
} catch (error) {
if (!isAuthFailure(error)) {
throw error;