Skip to content

Commit

Permalink
Fix misleading error code when receiving invalid WebAuthn credentials (
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire authored Mar 15, 2023
1 parent cf50667 commit a232a1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def create
end
else
flash[:error] = I18n.t('webauthn_credentials.create.error')
status = :internal_server_error
status = :unprocessable_entity
end
else
flash[:error] = t('webauthn_credentials.create.error')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def add_webauthn_credential(user)

post :create, params: { credential: new_webauthn_credential, nickname: 'USB Key' }

expect(response).to have_http_status(500)
expect(response).to have_http_status(422)
expect(flash[:error]).to be_present
end
end
Expand All @@ -268,7 +268,7 @@ def add_webauthn_credential(user)

post :create, params: { credential: new_webauthn_credential, nickname: nickname }

expect(response).to have_http_status(500)
expect(response).to have_http_status(422)
expect(flash[:error]).to be_present
end
end
Expand Down

0 comments on commit a232a1f

Please sign in to comment.