feat: initial commit

This commit is contained in:
Mauricio Siu
2024-04-28 23:57:52 -06:00
parent 8857a20344
commit be56ba046c
412 changed files with 60777 additions and 1 deletions

26
reset-password.ts Normal file
View File

@@ -0,0 +1,26 @@
import { findAdmin } from "./server/api/services/admin";
import { updateAuthById } from "./server/api/services/auth";
import { generateRandomPassword } from "./server/auth/random-password";
(async () => {
try {
const randomPassword = await generateRandomPassword();
const result = await findAdmin();
const update = await updateAuthById(result.authId, {
password: randomPassword.hashedPassword,
});
if (update) {
console.log("Password reset successful");
console.log("New password: ", randomPassword.randomPassword);
} else {
console.log("Password reset failed");
}
process.exit(0);
} catch (error) {
console.log("Error to reset password", error);
}
})();