DEV: Add :before_email_login event for plugins (#15187)

This commit is contained in:
David Taylor 2021-12-06 01:38:37 +00:00 committed by GitHub
parent ce074d118e
commit 0b364140ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -928,6 +928,8 @@ class UsersController < ApplicationController
RateLimiter.new(nil, "email-login-min-#{user.id}", 3, 1.minute).performed!
if user_presence
DiscourseEvent.trigger(:before_email_login, user)
email_token = user.email_tokens.create!(email: user.email, scope: EmailToken.scopes[:email_login])
Jobs.enqueue(:critical_user_email,