mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
unified runtime and framework adapters
This commit is contained in:
@@ -287,14 +287,18 @@ export class AppAuth extends Module<typeof authConfigSchema> {
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
async createUser(input: { email: string; password: string }) {
|
||||
async createUser({
|
||||
email,
|
||||
password,
|
||||
...additional
|
||||
}: { email: string; password: string; [key: string]: any }) {
|
||||
const strategy = "password";
|
||||
const pw = this.authenticator.strategy(strategy) as PasswordStrategy;
|
||||
const strategy_value = await pw.hash(input.password);
|
||||
const strategy_value = await pw.hash(password);
|
||||
const mutator = this.em.mutator(this.config.entity_name as "users");
|
||||
mutator.__unstable_toggleSystemEntityCreation(false);
|
||||
const { data: created } = await mutator.insertOne({
|
||||
email: input.email,
|
||||
...(additional as any),
|
||||
strategy,
|
||||
strategy_value
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user