Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Update browser extension login UI (#1347)
Leendert de Borst81750c48785d
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/auth/Login.tsx b/apps/browser-extension/src/entrypoints/popup/pages/auth/Login.tsxindex 6b3adc3ea..61238e6f7 100644--- a/apps/browser-extension/src/entrypoints/popup/pages/auth/Login.tsx+++ b/apps/browser-extension/src/entrypoints/popup/pages/auth/Login.tsx@@ -402,114 +402,114 @@ const Login: React.FC = () => {}return (- <div>- <form onSubmit={handleSubmit} className="bg-white dark:bg-gray-700 w-full shadow-md rounded px-8 pt-6 pb-8 mb-4">- {error && (- <div className="mb-4 text-red-500 dark:text-red-400 text-sm">- {error}+ <div className="flex flex-col items-center justify-center p-4">+ <div className="w-full max-w-md">+ <form onSubmit={handleSubmit} className="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6">+ {/* Title */}+ <div className="text-center mb-6">+ <h2 className="text-xl font-bold text-gray-900 dark:text-white">{t('auth.loginTitle')}</h2>+ <LoginServerInfo /></div>- )}- <h2 className="text-xl font-bold dark:text-gray-200">{t('auth.loginTitle')}</h2>- <LoginServerInfo />- <div className="mb-4">- <label className="block text-gray-700 dark:text-gray-200 font-bold mb-2" htmlFor="username">- {t('auth.username')}- </label>- <input- className="shadow text-sm appearance-none border rounded w-full py-2 px-3 text-gray-700 dark:text-gray-200 dark:bg-gray-800 dark:border-gray-600 leading-tight focus:outline-none focus:shadow-outline"- id="username"- type="text"- name="username"- placeholder={t('auth.usernamePlaceholder')}- value={credentials.username}- onChange={handleChange}- required- />- </div>- <div className="mb-4">- <label className="block text-gray-700 dark:text-gray-200 font-bold mb-2" htmlFor="password">- {t('auth.password')}- </label>- <div className="relative">++ {/* Error Message */}+ {error && (+ <div className="mb-4 text-red-500 dark:text-red-400 text-sm">+ {error}+ </div>+ )}++ <div className="mb-4">+ <label className="block text-gray-700 dark:text-gray-200 font-medium mb-2" htmlFor="username">+ {t('auth.username')}+ </label><input- className="shadow text-sm appearance-none border rounded w-full py-2 px-3 pr-10 text-gray-700 dark:text-gray-200 dark:bg-gray-800 dark:border-gray-600 mb-3 leading-tight focus:outline-none focus:shadow-outline"- id="password"- type={showPassword ? "text" : "password"}- name="password"- placeholder={t('auth.passwordPlaceholder')}- value={credentials.password}+ className="shadow appearance-none border rounded-lg w-full py-2 px-3 text-gray-700 dark:text-gray-200 dark:bg-gray-700 dark:border-gray-600 leading-tight focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"+ id="username"+ type="text"+ name="username"+ placeholder={t('auth.usernamePlaceholder')}+ value={credentials.username}onChange={handleChange}required/>- <button- type="button"- className="absolute right-2 top-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"- onClick={() => setShowPassword(!showPassword)}- tabIndex={-1}- >- <HeaderIcon type={showPassword ? HeaderIconType.EYE_OFF : HeaderIconType.EYE} className="w-5 h-5 text-gray-400 dark:text-gray-500" />- </button></div>- </div>- <div className="mb-6">- <label className="flex items-center">- <input- type="checkbox"- checked={rememberMe}- onChange={(e) => setRememberMe(e.target.checked)}- className="mr-2"- />- <span className="text-sm text-gray-700 dark:text-gray-200">{t('auth.rememberMe')}</span>- </label>- </div>- <div className="flex flex-col w-full space-y-4">+ <div className="mb-4">+ <label className="block text-gray-700 dark:text-gray-200 font-medium mb-2" htmlFor="password">+ {t('auth.password')}+ </label>+ <div className="relative">+ <input+ className="shadow appearance-none border rounded-lg w-full py-2 px-3 pr-10 text-gray-700 dark:text-gray-200 dark:bg-gray-700 dark:border-gray-600 leading-tight focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"+ id="password"+ type={showPassword ? "text" : "password"}+ name="password"+ placeholder={t('auth.passwordPlaceholder')}+ value={credentials.password}+ onChange={handleChange}+ required+ />+ <button+ type="button"+ className="absolute right-2 top-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"+ onClick={() => setShowPassword(!showPassword)}+ tabIndex={-1}+ >+ <HeaderIcon type={showPassword ? HeaderIconType.EYE_OFF : HeaderIconType.EYE} className="w-5 h-5 text-gray-400 dark:text-gray-500" />+ </button>+ </div>+ </div>+ <div className="mb-6">+ <label className="flex items-center">+ <input+ type="checkbox"+ checked={rememberMe}+ onChange={(e) => setRememberMe(e.target.checked)}+ className="mr-2"+ />+ <span className="text-sm text-gray-700 dark:text-gray-200">{t('auth.rememberMe')}</span>+ </label>+ </div>+<Button type="submit"><div className="flex items-center justify-center gap-2">{t('auth.loginButton')}</div></Button>- <div className="relative">- <div className="absolute inset-0 flex items-center">- <div className="w-full border-t border-gray-300 dark:border-gray-600"></div>- </div>- <div className="relative flex justify-center text-sm">- <span className="px-2 text-gray-500 bg-white dark:bg-gray-700 dark:text-gray-400">{t('common.or')}</span>- </div>+ <div className="text-center text-sm text-gray-500 dark:text-gray-400 mt-6">+ {t('auth.noAccount')}{' '}+ <a+ href={clientUrl ?? ''}+ target="_blank"+ rel="noopener noreferrer"+ className="text-orange-500 hover:text-orange-600 dark:text-orange-400 dark:hover:text-orange-500"+ >+ {t('auth.createVault')}+ </a></div>+ </form>- <button- type="button"- onClick={() => setShowMobileLoginModal(true)}- className="w-full px-4 py-2 text-sm font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-600 dark:text-white dark:border-gray-500 dark:hover:bg-gray-500 dark:focus:ring-gray-700 flex items-center justify-center gap-2"- >- <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"></path>- </svg>- {t('auth.loginWithMobile')}- </button>- </div>- </form>- <div className="text-center text-gray-600 dark:text-gray-400">- {t('auth.noAccount')}{' '}- <a- href={clientUrl ?? ''}- target="_blank"- rel="noopener noreferrer"- className="text-orange-500 hover:text-orange-600 dark:text-orange-400 dark:hover:text-orange-500"+ {/* Mobile Login Button */}+ <button+ type="button"+ onClick={() => setShowMobileLoginModal(true)}+ className="w-full max-w-md mt-4 px-4 py-2 text-sm font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-600 dark:text-white dark:border-gray-500 dark:hover:bg-gray-500 dark:focus:ring-gray-700 flex items-center justify-center gap-2">- {t('auth.createVault')}- </a>+ <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"></path>+ </svg>+ {t('auth.loginWithMobile')}+ </button>++ {/* Mobile Login Modal */}+ <MobileUnlockModal+ isOpen={showMobileLoginModal}+ onClose={() => setShowMobileLoginModal(false)}+ onSuccess={handleMobileLoginSuccess}+ webApi={webApi}+ mode="login"+ /></div>-- {/* Mobile Login Modal */}- <MobileUnlockModal- isOpen={showMobileLoginModal}- onClose={() => setShowMobileLoginModal(false)}- onSuccess={handleMobileLoginSuccess}- webApi={webApi}- mode="login"- /></div>);};