chore: clean up code by removing trailing whitespace and ensuring consistent formatting across various files = prettier

This commit is contained in:
Julien Froidefond
2025-12-01 08:37:30 +01:00
parent 757b1b84ab
commit e715779de7
98 changed files with 5453 additions and 3126 deletions

View File

@@ -20,7 +20,11 @@ async function ensurePasswordFile(): Promise<void> {
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
};
await fs.writeFile(PASSWORD_FILE, JSON.stringify(defaultData, null, 2), "utf-8");
await fs.writeFile(
PASSWORD_FILE,
JSON.stringify(defaultData, null, 2),
"utf-8",
);
}
}
@@ -45,7 +49,10 @@ export const authService = {
}
},
async changePassword(oldPassword: string, newPassword: string): Promise<{ success: boolean; error?: string }> {
async changePassword(
oldPassword: string,
newPassword: string,
): Promise<{ success: boolean; error?: string }> {
try {
// Verify old password
const isValid = await this.verifyPassword(oldPassword);
@@ -56,17 +63,20 @@ export const authService = {
// Hash new password
const newHash = await bcrypt.hash(newPassword, 10);
const data = await loadPasswordData();
// Update password
data.hash = newHash;
data.updatedAt = new Date().toISOString();
await savePasswordData(data);
return { success: true };
} catch (error) {
console.error("Error changing password:", error);
return { success: false, error: "Erreur lors du changement de mot de passe" };
return {
success: false,
error: "Erreur lors du changement de mot de passe",
};
}
},
@@ -79,4 +89,3 @@ export const authService = {
}
},
};