Unable to log out, and navigation list not correct
Reproduce: Log in. Click around in navigation. Log out. Error.
It seems that we make two calls to action destroy in controller session:
Started DELETE "/signout" for 127.0.0.1 at 2014-09-11 23:35:52 +0200
Processing by SessionsController#destroy as HTML
Parameters: {"authenticity_token"=>"EnuvYj+haJBAfNMZM9wHht8J39FEqL0UbNbGvMs7Hrw="}
sign_out
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."remember_token" = 'adadf53cb92fde2725119922e01837fa1412d73c' LIMIT 1
(0.1ms) begin transaction
SQL (0.3ms) UPDATE "users" SET "remember_token" = ?, "updated_at" = ? WHERE "users"."id" = 2 [["remember_token", "25a2e6e37190e032118c890662f98e4f92465023"], ["updated_at", "2014-09-11 21:35:52.643454"]]
(5.8ms) commit transaction
Redirected to http://localhost:3000/signin
Completed 302 Found in 10ms (ActiveRecord: 6.5ms)
Started DELETE "/signout" for 127.0.0.1 at 2014-09-11 23:35:52 +0200
Processing by SessionsController#destroy as HTML
Parameters: {"authenticity_token"=>"EnuvYj+haJBAfNMZM9wHht8J39FEqL0UbNbGvMs7Hrw="}
sign_out
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."remember_token" = 'adadf53cb92fde2725119922e01837fa1412d73c' LIMIT 1
Completed 500 Internal Server Error in 1ms
NoMethodError (undefined method `update_attribute' for nil:NilClass):
app/helpers/sessions_helper.rb:12:in `sign_out'
app/controllers/sessions_controller.rb:17:in `destroy'
Rendered /Users/Martin/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/_source.erb (1.0ms)
Rendered /Users/Martin/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.0ms)
Rendered /Users/Martin/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.7ms)
Rendered /Users/Martin/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (20.7ms)
Secondly, navigation list is incorrect. When user is logged in, some of the static_pages lists correctly, while others omit admin link and log out link.
Comments (9)
-
reporter -
repo owner Admin can now log out.
Removed turbolinks from project. The gem caused extra calls to the sign out action, so it had to be removed. Also cleaned up ther routing linked to the signin/signout functionality.
refs
#44→ <<cset 9fe325b27914>>
-
repo owner -
repo owner - changed status to resolved
Resolved with pull request #42 and pull request #43
-
repo owner Admin can now log out.
Removed turbolinks from project. The gem caused extra calls to the sign out action, so it had to be removed. Also cleaned up ther routing linked to the signin/signout functionality.
refs
#44→ <<cset ecee42187666>>
-
repo owner -
reporter Admin can now log out.
Removed turbolinks from project. The gem caused extra calls to the sign out action, so it had to be removed. Also cleaned up ther routing linked to the signin/signout functionality.
refs
#44→ <<cset 9fe325b27914>>
-
reporter -
repo owner - removed milestone
Removing milestone: Systemet färdigt (DL: 14/9) (automated comment)
- Log in to comment
Admin can now log out.
Removed turbolinks from project. The gem caused extra calls to the sign out action, so it had to be removed. Also cleaned up ther routing linked to the signin/signout functionality.
refs
#44→ <<cset fece582e8cab>>