Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Fix inline unlock mode (#541)

Leendert de Borsta22dbc59accc
diff --git a/browser-extensions/chrome/src/app/components/Layout/BottomNav.tsx b/browser-extensions/chrome/src/app/components/Layout/BottomNav.tsx
index 15f22471d..2f2e507aa 100644
--- a/browser-extensions/chrome/src/app/components/Layout/BottomNav.tsx
+++ b/browser-extensions/chrome/src/app/components/Layout/BottomNav.tsx
@@ -31,6 +31,15 @@ const BottomNav: React.FC<BottomNavProps> = ({ currentTab, setCurrentTab }) => {
return null;
}
+ // Detect if the user is coming from the unlock page with mode=inline_unlock.
+ const urlParams = new URLSearchParams(window.location.search);
+ const isInlineUnlockMode = urlParams.get('mode') === 'inline_unlock';
+
+ if (isInlineUnlockMode) {
+ // Do not show the bottom nav for inline unlock mode.
+ return null;
+ }
+
return (
<div className="fixed bottom-0 left-0 right-0 bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700">
<div className="flex justify-around items-center h-14">
diff --git a/browser-extensions/chrome/src/app/pages/Home.tsx b/browser-extensions/chrome/src/app/pages/Home.tsx
index 6916b4ed0..008d5f108 100644
--- a/browser-extensions/chrome/src/app/pages/Home.tsx
+++ b/browser-extensions/chrome/src/app/pages/Home.tsx
@@ -18,6 +18,11 @@ const Home: React.FC = () => {
const needsUnlock = (!authContext.isLoggedIn && authContext.isInitialized) || (!dbContext.dbAvailable && dbContext.dbInitialized);
useEffect(() => {
+ // Detect if the user is coming from the unlock page with mode=inline_unlock
+ const urlParams = new URLSearchParams(window.location.search);
+ const isInlineUnlockMode = urlParams.get('mode') === 'inline_unlock';
+ setIsInlineUnlockMode(isInlineUnlockMode);
+
if (isLoggedIn && !needsUnlock && !isInlineUnlockMode) {
navigate('/credentials', { replace: true });
}
diff --git a/browser-extensions/chrome/src/app/pages/UnlockSuccess.tsx b/browser-extensions/chrome/src/app/pages/UnlockSuccess.tsx
index 25f82deb0..de751f12f 100644
--- a/browser-extensions/chrome/src/app/pages/UnlockSuccess.tsx
+++ b/browser-extensions/chrome/src/app/pages/UnlockSuccess.tsx
@@ -27,7 +27,13 @@ const UnlockSuccess: React.FC<{
Close this popup
</button>
<button
- onClick={() => onClose()}
+ onClick={() => {
+ // Remove mode=inline from URL before closing
+ const url = new URL(window.location.href);
+ url.searchParams.delete('mode');
+ window.history.replaceState({}, '', url);
+ onClose();
+ }}
className="w-full px-4 py-2 text-gray-700 bg-gray-100 rounded hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600"
>
Browse vault contents