Skip to content

Commit

Permalink
fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
markusahlstrand committed Dec 16, 2024
1 parent 5db636b commit 4430ec4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 354 deletions.
2 changes: 1 addition & 1 deletion packages/authhero/src/emails/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function sendEmail(
throw new HTTPException(500, { message: "Email provider not found" });
}

const emailService = ctx.env.emailProvders?.[emailProvider.name];
const emailService = ctx.env.emailProviders?.[emailProvider.name];
if (!emailService) {
throw new HTTPException(500, { message: "Email provider not found" });
}
Expand Down
350 changes: 0 additions & 350 deletions packages/authhero/src/emails/templates/password-reset.ts

This file was deleted.

3 changes: 2 additions & 1 deletion packages/authhero/src/routes/auth-api/dbconnections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ export const dbConnectionRoutes = new OpenAPIHono<{
ctx.set("connection", newUser.connection);

// Store the password
const hashedPassword = await bcryptjs.hash(password, 10);
await ctx.env.data.passwords.create(client.tenant.id, {
user_id: newUser.user_id,
password: bcryptjs.hashSync(password, 10),
password: hashedPassword,
algorithm: "bcrypt",
});

Expand Down
2 changes: 1 addition & 1 deletion packages/authhero/src/types/Bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type Bindings = {
hooks?: {
onExecuteCredentialsExchange?: OnExecuteCredentialsExchange;
};
emailProvders?: { [key: string]: EmailService };
emailProviders?: { [key: string]: EmailService };

// Constants
JWKS_CACHE_TIMEOUT_IN_SECONDS: number;
Expand Down
2 changes: 1 addition & 1 deletion packages/authhero/test/helpers/test-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export async function getTestServer(args: getEnvParams = {}) {

const env: Bindings = {
data,
emailProvders: {
emailProviders: {
"mock-email": mockEmailService.sendEmail.bind(mockEmailService),
},
JWKS_SERVICE: {
Expand Down

0 comments on commit 4430ec4

Please sign in to comment.