mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Compare commits
2 commits
a733f4e535
...
2836fb31a8
Author | SHA1 | Date | |
---|---|---|---|
|
2836fb31a8 | ||
|
2b8292aba5 |
2 changed files with 2 additions and 4 deletions
|
@ -68,7 +68,7 @@ Mastodon acts as an OAuth2 provider, so 3rd party apps can use the REST and Stre
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
- **PostgreSQL** 12+
|
- **PostgreSQL** 12+
|
||||||
- **Redis** 4+
|
- **Redis** 6.2+
|
||||||
- **Ruby** 3.1+
|
- **Ruby** 3.1+
|
||||||
- **Node.js** 18+
|
- **Node.js** 18+
|
||||||
|
|
||||||
|
|
|
@ -183,9 +183,7 @@ class Auth::SessionsController < Devise::SessionsController
|
||||||
)
|
)
|
||||||
|
|
||||||
# Only send a notification email every hour at most
|
# Only send a notification email every hour at most
|
||||||
return if redis.get("2fa_failure_notification:#{user.id}").present?
|
return if redis.set("2fa_failure_notification:#{user.id}", '1', ex: 1.hour, get: true).present?
|
||||||
|
|
||||||
redis.set("2fa_failure_notification:#{user.id}", '1', ex: 1.hour)
|
|
||||||
|
|
||||||
UserMailer.failed_2fa(user, request.remote_ip, request.user_agent, Time.now.utc).deliver_later!
|
UserMailer.failed_2fa(user, request.remote_ip, request.user_agent, Time.now.utc).deliver_later!
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue