forked from mastodon/mastodon
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 2FA challenge and password challenge for non-database users (mast…
…odon#11831) * Fix 2FA challenge not appearing for non-database users Fix mastodon#11685 * Fix account deletion not working when using external login Fix mastodon#11691
- Loading branch information
1 parent
5d8259c
commit b561a7a
Showing
7 changed files
with
66 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,11 @@ | |
RSpec.describe Auth::SessionsController, type: :controller do | ||
render_views | ||
|
||
describe 'GET #new' do | ||
before do | ||
request.env['devise.mapping'] = Devise.mappings[:user] | ||
end | ||
before do | ||
request.env['devise.mapping'] = Devise.mappings[:user] | ||
end | ||
|
||
describe 'GET #new' do | ||
it 'returns http success' do | ||
get :new | ||
expect(response).to have_http_status(200) | ||
|
@@ -19,10 +19,6 @@ | |
describe 'DELETE #destroy' do | ||
let(:user) { Fabricate(:user) } | ||
|
||
before do | ||
request.env['devise.mapping'] = Devise.mappings[:user] | ||
end | ||
|
||
context 'with a regular user' do | ||
it 'redirects to home after sign out' do | ||
sign_in(user, scope: :user) | ||
|
@@ -51,10 +47,6 @@ | |
end | ||
|
||
describe 'POST #create' do | ||
before do | ||
request.env['devise.mapping'] = Devise.mappings[:user] | ||
end | ||
|
||
context 'using PAM authentication', if: ENV['PAM_ENABLED'] == 'true' do | ||
context 'using a valid password' do | ||
before do | ||
|
@@ -191,11 +183,11 @@ | |
end | ||
|
||
context 'using two-factor authentication' do | ||
let(:user) do | ||
Fabricate(:user, email: '[email protected]', password: 'abcdefgh', | ||
otp_required_for_login: true, otp_secret: User.generate_otp_secret(32)) | ||
let!(:user) do | ||
Fabricate(:user, email: '[email protected]', password: 'abcdefgh', otp_required_for_login: true, otp_secret: User.generate_otp_secret(32)) | ||
end | ||
let(:recovery_codes) do | ||
|
||
let!(:recovery_codes) do | ||
codes = user.generate_otp_backup_codes! | ||
user.save | ||
return codes | ||
|