Skip to content

Commit

Permalink
Fix error on deleting device used for login (#729)
Browse files Browse the repository at this point in the history
This fixes a bug showing an error loading the list of devices after deleting the device that was used to authenticate the current session with.
  • Loading branch information
frederikrothenberger authored Jul 5, 2022
1 parent d0be7f3 commit d1935e2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/frontend/src/flows/manage/deviceSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ const init = async (
}
await removalConnection.remove(userNumber, device.pubkey);
});

if (sameDevice) {
// clear anchor and reload the page.
// do not resolve, otherwise the management page will try to reload the list of devices which will cause an error
localStorage.clear();
location.reload();
return;
}
resolve();
};
}
Expand Down

0 comments on commit d1935e2

Please sign in to comment.