mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-29 08:00:06 +00:00
fix(forms): keep password managers out of a place's contact fields and the admin user forms
1Password filled the signed-in user's login into a place's e-mail field, and offered the admin's own credentials for an account being created. The fields now carry each manager's opt-out; autocomplete=off alone is ignored.
This commit is contained in:
@@ -6,6 +6,7 @@ import type { useAdmin } from '../../../pages/admin/useAdmin'
|
||||
import MSheet from '../../components/MSheet'
|
||||
import MSegmented from '../../components/MSegmented'
|
||||
import { MAdminButton, MAdminField, MAdminInput, MAdminSecretInput, MAdminSheetFrame } from './MAdminUi'
|
||||
import { NO_AUTOFILL } from '../../../utils/noAutofill'
|
||||
|
||||
interface MAdminSheetsProps {
|
||||
admin: ReturnType<typeof useAdmin>
|
||||
@@ -78,6 +79,7 @@ export default function MAdminSheets({ admin, t }: MAdminSheetsProps) {
|
||||
value={createForm.username}
|
||||
onChange={(e) => setCreateForm((f) => ({ ...f, username: e.target.value }))}
|
||||
placeholder={t('settings.username')}
|
||||
{...NO_AUTOFILL}
|
||||
/>
|
||||
</MAdminField>
|
||||
<MAdminField label={`${t('common.email')} *`}>
|
||||
@@ -86,6 +88,7 @@ export default function MAdminSheets({ admin, t }: MAdminSheetsProps) {
|
||||
value={createForm.email}
|
||||
onChange={(e) => setCreateForm((f) => ({ ...f, email: e.target.value }))}
|
||||
placeholder={t('common.email')}
|
||||
{...NO_AUTOFILL}
|
||||
/>
|
||||
</MAdminField>
|
||||
<MAdminField label={`${t('common.password')} *`}>
|
||||
@@ -93,6 +96,7 @@ export default function MAdminSheets({ admin, t }: MAdminSheetsProps) {
|
||||
value={createForm.password}
|
||||
onChange={(e) => setCreateForm((f) => ({ ...f, password: e.target.value }))}
|
||||
placeholder={t('common.password')}
|
||||
autoComplete="new-password"
|
||||
/>
|
||||
</MAdminField>
|
||||
<MAdminField label={t('settings.role')}>
|
||||
@@ -127,6 +131,7 @@ export default function MAdminSheets({ admin, t }: MAdminSheetsProps) {
|
||||
type="text"
|
||||
value={editForm.username}
|
||||
onChange={(e) => setEditForm((f) => ({ ...f, username: e.target.value }))}
|
||||
{...NO_AUTOFILL}
|
||||
/>
|
||||
</MAdminField>
|
||||
<MAdminField label={t('common.email')}>
|
||||
@@ -134,6 +139,7 @@ export default function MAdminSheets({ admin, t }: MAdminSheetsProps) {
|
||||
type="email"
|
||||
value={editForm.email}
|
||||
onChange={(e) => setEditForm((f) => ({ ...f, email: e.target.value }))}
|
||||
{...NO_AUTOFILL}
|
||||
/>
|
||||
</MAdminField>
|
||||
<MAdminField label={t('admin.newPassword')} hint={t('admin.newPasswordHint')}>
|
||||
@@ -141,6 +147,7 @@ export default function MAdminSheets({ admin, t }: MAdminSheetsProps) {
|
||||
value={editForm.password}
|
||||
onChange={(e) => setEditForm((f) => ({ ...f, password: e.target.value }))}
|
||||
placeholder={t('admin.newPasswordPlaceholder')}
|
||||
autoComplete="new-password"
|
||||
/>
|
||||
</MAdminField>
|
||||
<MAdminField label={t('settings.role')}>
|
||||
|
||||
Reference in New Issue
Block a user