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

ReauthenticationControllerConcern and SessionsControllerConcern raise NoMethodError if the relying_party has not been overridden #32

Merged
merged 3 commits into from
Jun 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## [Unreleased]

- `ReauthenticationControllerConcern` and `SessionsControllerConcern` raise `NoMethodError` if the `relying_party` has not been overridden
- https://github.com/ruby-passkeys/devise-passkeys/pull/32
- [Bump to warden-webauthn 0.2.1](https://github.com/ruby-passkeys/devise-passkeys/pull/29/commits/d825ffded91aa98801bdd5530442761aa60538f9)
- [Use `Warden::WebAuthn::RackHelper.set_relying_party_in_request_env` to streamline setup](https://github.com/ruby-passkeys/devise-passkeys/pull/29/commits/7b7d50129ebe83b0a224d0ace0e4cff8ea407f4a)
- [Refactor PasskeysControllerConcern to have clearer credential verify with `verify_credential_integrity`](https://github.com/ruby-passkeys/devise-passkeys/pull/29/commits/f1400cb4b217c20b9e74fda3f55f74284e373d25)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def delete_reauthentication_challenge
end

def relying_party
raise "need to define relying_party for this SessionsController"
raise NoMethodError, "need to define relying_party for this #{self.class.name}"
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def new_challenge
protected

def relying_party
raise "need to define relying_party for this SessionsController"
raise NoMethodError, "need to define relying_party for this #{self.class.name}"
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,10 @@ def root_path
Rails.application.reload_routes!
end

test "#new_challenge: raises RuntimeError if set_relying_party_in_request_env has not been implemented" do
test "#new_challenge: raises NoMethodError if relying_party has not been implemented" do
user = User.create!(email: "test@test.com")
sign_in(user)
assert_raises RuntimeError do
assert_raises NoMethodError do
post "/reauthentication/new_challenge"
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ def resource_name
Rails.application.reload_routes!
end

test "#new_challenge: raises RuntimeError if set_relying_party_in_request_env has not been implemented" do
assert_raises RuntimeError do
test "#new_challenge: raises RuntimeError if relying_party has not been implemented" do
assert_raises NoMethodError do
post "/session/new_challenge"
end
end
Expand Down