Просмотр исходного кода

[web] Prevent 6-digits verification on SSO-emails (#27496)

* Rename token -> code

* Add test: don't verify SSO emails through the 6-digits verification

* Add a test on `/user/emails/resend-confirmation-code`

* Rename to `confirmationEmailMiddleware`

* Add `Modules.middleware('confirmationEmailMiddleware')` to `/user/emails/send-confirmation-code`

* Log attempted verifications of SAML emails

GitOrigin-RevId: ccc11831c860b219711cd57bba1a76ac975e71fb
Antoine Clausse 1 год назад
Родитель
Сommit
85878cdd8b
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      services/web/app/src/router.mjs

+ 1 - 0
services/web/app/src/router.mjs

@@ -346,6 +346,7 @@ async function initialize(webRouter, privateApiRouter, publicApiRouter) {
     '/user/emails/send-confirmation-code',
     AuthenticationController.requireLogin(),
     RateLimiterMiddleware.rateLimit(rateLimiters.sendConfirmation),
+    await Modules.middleware('confirmationEmailMiddleware'),
     UserEmailsController.sendExistingEmailConfirmationCode
   )