Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix suspicious sign-in mails never being sent #18599

Merged
merged 2 commits into from
Jun 21, 2022

Conversation

ClearlyClaire
Copy link
Contributor

#17970 has replaced sign-in token verification by warning emails.

However, the log-in activity record was created before checking for suspicious log-ins, so logins were never considered suspicious.

Additionally, a much trickier reason that logins where never considered suspicious is that log-in actually happens before Auth::SessionsController#create is called. This is caused by the Localized concern being included (through Devise::FailureApp.send :include, Localized) and using current_user in a around_action hook. This is why the suspicious login test is now performed in a prepended before_action hook.

The added tests account for both these reasons.

@ClearlyClaire ClearlyClaire added the security Security issues and fixes, vulnerabilities label Jun 3, 2022
@ClearlyClaire
Copy link
Contributor Author

@Gargron ping

@Gargron Gargron merged commit 327eed0 into mastodon:main Jun 21, 2022
kadoshita pushed a commit to kadoshita/mastodon that referenced this pull request Nov 19, 2022
* Add tests

* Fix suspicious sign-in mails never being sent
ClearlyClaire added a commit to ClearlyClaire/mastodon that referenced this pull request Jul 6, 2023
* Add tests

* Fix suspicious sign-in mails never being sent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security Security issues and fixes, vulnerabilities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants