mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-12-01 06:55:45 +01:00
changed static password length statements 6 -> 8
This commit is contained in:
@@ -766,7 +766,7 @@ export const changePassword = async (req: AuthRequest, res: Response): Promise<v
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Validate new password
|
// Validate new password
|
||||||
if (!newPassword || newPassword.length < 6) {
|
if (!newPassword || newPassword.length < 8) {
|
||||||
res.status(400).json({ error: 'New password must be at least 8 characters long' });
|
res.status(400).json({ error: 'New password must be at least 8 characters long' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,8 +75,8 @@ export const setupAdmin = async (req: Request, res: Response): Promise<void> =>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Password length validation
|
// Password length validation
|
||||||
if (password.length < 6) {
|
if (password.length < 8) {
|
||||||
res.status(400).json({ error: 'Das Passwort muss mindestens 6 Zeichen lang sein' });
|
res.status(400).json({ error: 'Das Passwort muss mindestens 8 Zeichen lang sein' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
### \[CREATE\] Employee
|
### \[CREATE\] Employee
|
||||||
* `firstname` 1-100 characters and must not be empty
|
* `firstname` 1-100 characters and must not be empty
|
||||||
* `lastname` 1-100 characters and must not be empty
|
* `lastname` 1-100 characters and must not be empty
|
||||||
* `password` must be at least 6 characters (in create mode)
|
* `password` must be at least 8 characters (in create mode)
|
||||||
* `employeeType` must be `manager`, `personell`, `apprentice`, or `guest`
|
* `employeeType` must be `manager`, `personell`, `apprentice`, or `guest`
|
||||||
* `canWorkAlone` optional boolean
|
* `canWorkAlone` optional boolean
|
||||||
* `isTrainee` optional boolean
|
* `isTrainee` optional boolean
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ function generateEmail(firstname: string, lastname: string): string {
|
|||||||
export function validateEmployeeData(employee: CreateEmployeeRequest): string[] {
|
export function validateEmployeeData(employee: CreateEmployeeRequest): string[] {
|
||||||
const errors: string[] = [];
|
const errors: string[] = [];
|
||||||
|
|
||||||
if (employee.password?.length < 6) {
|
if (employee.password?.length < 8) {
|
||||||
errors.push('Password must be at least 6 characters long');
|
errors.push('Password must be at least 8 characters long');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!employee.firstname?.trim() || employee.firstname.trim().length < 2) {
|
if (!employee.firstname?.trim() || employee.firstname.trim().length < 2) {
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ function generateEmail(firstname: string, lastname: string): string {
|
|||||||
export function validateEmployeeData(employee: CreateEmployeeRequest): string[] {
|
export function validateEmployeeData(employee: CreateEmployeeRequest): string[] {
|
||||||
const errors: string[] = [];
|
const errors: string[] = [];
|
||||||
|
|
||||||
if (employee.password?.length < 6) {
|
if (employee.password?.length < 8) {
|
||||||
errors.push('Password must be at least 6 characters long');
|
errors.push('Password must be at least 8 characters long');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!employee.firstname?.trim() || employee.firstname.trim().length < 2) {
|
if (!employee.firstname?.trim() || employee.firstname.trim().length < 2) {
|
||||||
|
|||||||
@@ -203,11 +203,11 @@ const Settings: React.FC = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (passwordForm.newPassword.length < 6) {
|
if (passwordForm.newPassword.length < 8) {
|
||||||
showNotification({
|
showNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
title: 'Fehler',
|
title: 'Fehler',
|
||||||
message: 'Das neue Passwort muss mindestens 6 Zeichen lang sein'
|
message: 'Das neue Passwort muss mindestens 8 Zeichen lang sein'
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -600,9 +600,9 @@ const Settings: React.FC = () => {
|
|||||||
value={passwordForm.newPassword}
|
value={passwordForm.newPassword}
|
||||||
onChange={handlePasswordChange}
|
onChange={handlePasswordChange}
|
||||||
required
|
required
|
||||||
minLength={6}
|
minLength={8}
|
||||||
style={styles.fieldInputWithIcon}
|
style={styles.fieldInputWithIcon}
|
||||||
placeholder="Mindestens 6 Zeichen"
|
placeholder="Mindestens 8 Zeichen"
|
||||||
onFocus={(e) => {
|
onFocus={(e) => {
|
||||||
e.target.style.borderColor = '#1a1325';
|
e.target.style.borderColor = '#1a1325';
|
||||||
e.target.style.boxShadow = '0 0 0 3px rgba(26, 19, 37, 0.1)';
|
e.target.style.boxShadow = '0 0 0 3px rgba(26, 19, 37, 0.1)';
|
||||||
@@ -631,7 +631,7 @@ const Settings: React.FC = () => {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div style={styles.fieldHint}>
|
<div style={styles.fieldHint}>
|
||||||
Das Passwort muss mindestens 6 Zeichen lang sein.
|
Das Passwort muss mindestens 8 Zeichen lang sein.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ const useSetup = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const validateStep2 = (): boolean => {
|
const validateStep2 = (): boolean => {
|
||||||
if (formData.password.length < 6) {
|
if (formData.password.length < 8) {
|
||||||
setError('Das Passwort muss mindestens 6 Zeichen lang sein.');
|
setError('Das Passwort muss mindestens 8 Zeichen lang sein.');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (formData.password !== formData.confirmPassword) {
|
if (formData.password !== formData.confirmPassword) {
|
||||||
@@ -186,8 +186,8 @@ const useSetup = () => {
|
|||||||
const isStepCompleted = (stepIndex: number): boolean => {
|
const isStepCompleted = (stepIndex: number): boolean => {
|
||||||
switch (stepIndex) {
|
switch (stepIndex) {
|
||||||
case 0:
|
case 0:
|
||||||
return formData.password.length >= 6 &&
|
return formData.password.length >= 8 &&
|
||||||
formData.password === formData.confirmPassword;
|
formData.password === formData.confirmPassword;
|
||||||
case 1:
|
case 1:
|
||||||
return !!formData.firstname.trim() && !!formData.lastname.trim();
|
return !!formData.firstname.trim() && !!formData.lastname.trim();
|
||||||
default:
|
default:
|
||||||
@@ -342,7 +342,7 @@ const Step2Content: React.FC<StepContentProps> = ({
|
|||||||
fontSize: '1rem',
|
fontSize: '1rem',
|
||||||
transition: 'border-color 0.3s ease'
|
transition: 'border-color 0.3s ease'
|
||||||
}}
|
}}
|
||||||
placeholder="Mindestens 6 Zeichen"
|
placeholder="Mindestens 8 Zeichen"
|
||||||
required
|
required
|
||||||
autoComplete="new-password"
|
autoComplete="new-password"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user