Skip to content

Commit fd50cf0

Browse files
committed
style(auth): simplify OTP redaction regex
Use concise digit character classes so SonarCloud accepts the OTP subject sanitizer added for #185.\n\nCo-authored-by: OpenAI <noreply@openai.com>
1 parent 6bfa3db commit fd50cf0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/auth-service/src/routes/resend-webhook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function verifyResendWebhook(
147147
}
148148

149149
const NUMERIC_OTP_CANDIDATE =
150-
/(^|[^0-9])((?:[0-9]{3,4}(?: [0-9]{3,4}){1,3}|[0-9]{4,12}))(?![0-9])/g
150+
/(^|\D)((?:\d{3,4}(?: \d{3,4}){1,3}|\d{4,12}))(?!\d)/g
151151
const ALPHANUMERIC_OTP_CANDIDATE =
152152
/(^|[^A-Za-z0-9])((?:[A-Z0-9]{3,4}(?: [A-Z0-9]{3,4}){1,3}|[A-Z0-9]{4,12}))(?![A-Za-z0-9])/g
153153

0 commit comments

Comments
 (0)