getappmap / appmap-ruby

AppMap client agent for Ruby
https://appland.org
Other
98 stars 11 forks source link

Error occurs when passing bad credentials to devise. #323

Closed tomvleonard closed 1 year ago

tomvleonard commented 1 year ago

Hello!

This is occurring in a rails app running rails 7.0.1 and devise 4.8.1. When entering bad credentials (blank, for example), the expected result is that it should display the devise error message 'Failed to login'. The actual result is that an error occurs at this line in appmap:

https://github.com/getappmap/appmap-ruby/blob/master/lib/appmap/handler/rails/request_handler.rb#L76

The error that I see:

NoMethodError in Admins::SessionsController#create
undefined method `status' for {:controller=>"Admins::SessionsController", :action=>"create", :request=>#<ActionDispatch::Request POST "http://localhost:3000/admins/sign_in" for 127.0.0.1>, :params=>{"authenticity_token"=>"[FILTERED]", "admin"=>{"username"=>"", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign In", "controller"=>"admins/sessions", "action"=>"create"}, :headers=>#<ActionDispatch::Http::Headers:0x000000010e1ead98 @req=#<ActionDispatch::Request POST "http://localhost:3000/admins/sign_in" for 127.0.0.1>>, :format=>:html, :method=>"POST", :path=>"/admins/sign_in", :view_runtime=>nil, :db_runtime=>4.178000211715698}:Hash

To recreate you'll need to have an app that uses devise for authentication and add the appmap gem to your Gemfile. Install and restart the server. Then, after signing out, enter bad credentials.

ghamelin commented 1 year ago

Hey Tom, thanks for reporting this, I'll get with the dev team to have them take a look.

kgilpin commented 1 year ago

:tada: This issue has been resolved in version 0.99.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: