I am debugging a problem about simple_token_authentication
, I modified some code in https://github.com/gonzalo-bulnes/simple_token_authentication/blob/master/lib/simple_token_authentication/sign_in_handler.rb#L7 to:
def sign_in(controller, record, *args)
begin
puts "=== TRACE 1"
integrate_with_devise_trackable!(controller)
puts "=== TRACE 2"
controller.send(:sign_in, record, *args)
puts "=== TRACE 3"
rescue Exception => e
puts "=== TRACE 4"
ensure
puts "=== TRACE 5"
end
end
Outputs:
Started GET "/projects" for ::1 at 2016-04-18 18:35:22 +0800
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by ProjectsController#index as JSON
Parameters: {"project"=>{}}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? ORDER BY "users"."id" ASC LIMIT 1 [["email", "testaccount@gmail.com"]]
=== TRACE 1
=== TRACE 2
(0.1ms) begin transaction
(0.0ms) commit transaction
=== TRACE 5
Completed 401 Unauthorized in 40ms (ActiveRecord: 0.9ms)
The question isn't about simple_token_authentication
, the question is why TRACE 3
and TRACE 4
both didn't output? Is there a possibly reason could cause th?
My environment:
- ruby-2.2.3 [ x86_64 ] installed by rvm
- Mac OSX 10.11.4