fix(setup): add password confirmation field to first-boot setup wizard
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 55s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 55s
This commit is contained in:
1 parent
7f312fef14
commit
38e9c28c63
1 file changed
+31
@@ -27,6 +27,7 @@ export const SetupAndAuthView: React.FC<SetupAndAuthViewProps> = ({
|
|||||||
const [setupName, setSetupName] = useState('');
|
const [setupName, setSetupName] = useState('');
|
||||||
const [setupEmail, setSetupEmail] = useState('');
|
const [setupEmail, setSetupEmail] = useState('');
|
||||||
const [setupPassword, setSetupPassword] = useState('');
|
const [setupPassword, setSetupPassword] = useState('');
|
||||||
|
const [setupPasswordConfirm, setSetupPasswordConfirm] = useState('');
|
||||||
const [instanceName, setInstanceName] = useState(authStatus.instanceName || 'MindSift');
|
const [instanceName, setInstanceName] = useState(authStatus.instanceName || 'MindSift');
|
||||||
const [sharingMode, setSharingMode] = useState<'open' | 'teams_only' | 'strict_private'>(
|
const [sharingMode, setSharingMode] = useState<'open' | 'teams_only' | 'strict_private'>(
|
||||||
'teams_only'
|
'teams_only'
|
||||||
@@ -47,6 +48,13 @@ export const SetupAndAuthView: React.FC<SetupAndAuthViewProps> = ({
|
|||||||
const handleCompleteSetup = async (e: React.FormEvent) => {
|
const handleCompleteSetup = async (e: React.FormEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setError(null);
|
setError(null);
|
||||||
|
|
||||||
|
if (setupPassword !== setupPasswordConfirm) {
|
||||||
|
setError('Die eingegebenen Passwörter stimmen nicht überein.');
|
||||||
|
triggerHaptic(25);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setSubmitting(true);
|
setSubmitting(true);
|
||||||
triggerHaptic(15);
|
triggerHaptic(15);
|
||||||
try {
|
try {
|
||||||
@@ -170,6 +178,7 @@ export const SetupAndAuthView: React.FC<SetupAndAuthViewProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-muted mb-1">Administrator-Passwort *</label>
|
<label className="block text-muted mb-1">Administrator-Passwort *</label>
|
||||||
<input
|
<input
|
||||||
@@ -182,6 +191,28 @@ export const SetupAndAuthView: React.FC<SetupAndAuthViewProps> = ({
|
|||||||
className="w-full h-8 px-2.5 input-field"
|
className="w-full h-8 px-2.5 input-field"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="block text-muted mb-1">Passwort wiederholen *</label>
|
||||||
|
<input
|
||||||
|
type="password"
|
||||||
|
value={setupPasswordConfirm}
|
||||||
|
onChange={(e) => setSetupPasswordConfirm(e.target.value)}
|
||||||
|
placeholder="Passwort erneut eingeben"
|
||||||
|
minLength={4}
|
||||||
|
required
|
||||||
|
className={`w-full h-8 px-2.5 input-field ${
|
||||||
|
setupPasswordConfirm && setupPassword !== setupPasswordConfirm
|
||||||
|
? 'border-status-err focus:border-status-err'
|
||||||
|
: ''
|
||||||
|
}`}
|
||||||
|
/>
|
||||||
|
{setupPasswordConfirm && setupPassword !== setupPasswordConfirm && (
|
||||||
|
<span className="text-[10px] text-status-err mt-1 block">
|
||||||
|
Passwörter stimmen nicht überein
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Section 2: Server & Isolation */}
|
{/* Section 2: Server & Isolation */}
|
||||||
|
|||||||
Reference in new issue
Block a user