fixed auth middleware

This commit is contained in:
dswbx
2025-01-11 08:28:46 +01:00
parent c06ba061f0
commit 0d945ab45b
3 changed files with 13 additions and 5 deletions

View File

@@ -276,6 +276,10 @@ export class AppAuth extends Module<typeof authConfigSchema> {
}
async createUser({ email, password, ...additional }: CreateUserPayload): Promise<DB["users"]> {
if (!this.enabled) {
throw new Error("Cannot create user, auth not enabled");
}
const strategy = "password";
const pw = this.authenticator.strategy(strategy) as PasswordStrategy;
const strategy_value = await pw.hash(password);