mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-04 18:14:53 +02:00
add strict rate limit to endpoints that send email
This commit is contained in:
parent
58a084426b
commit
3c7025a327
2 changed files with 46 additions and 5 deletions
|
@ -8,10 +8,8 @@ import { db } from "@server/db";
|
|||
import { passwordResetTokens, users } from "@server/db/schema";
|
||||
import { eq } from "drizzle-orm";
|
||||
import { alphabet, generateRandomString, sha256 } from "oslo/crypto";
|
||||
import { encodeHex } from "oslo/encoding";
|
||||
import { createDate } from "oslo";
|
||||
import logger from "@server/logger";
|
||||
import { generateIdFromEntropySize } from "@server/auth/sessions/app";
|
||||
import { TimeSpan } from "oslo";
|
||||
import config from "@server/lib/config";
|
||||
import { sendEmail } from "@server/emails";
|
||||
|
@ -85,7 +83,9 @@ export async function requestPasswordReset(
|
|||
const url = `${config.getRawConfig().app.dashboard_url}/auth/reset-password?email=${email}&token=${token}`;
|
||||
|
||||
if (!config.getRawConfig().email) {
|
||||
logger.info(`Password reset requested for ${email}. Token: ${token}.`);
|
||||
logger.info(
|
||||
`Password reset requested for ${email}. Token: ${token}.`
|
||||
);
|
||||
}
|
||||
|
||||
await sendEmail(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue