I'm doing some design/debugging in IRB and need to login a user and then be
able to gain access to current_user in my efforts (I'm using Devise for
authentication.)

I found a sequence from SO that allows me to successfully login via IRB and
access a page response:
ApplicationController.allow_forgery_protection = false
app.post('/sign_in', {"user"=>{"login"=>"some-login-id", "password"=>"some-password"}})
app.get '/some_other_path_that_only_works_if_logged_in'
pp app.response.body
I've been able to get session info:
app.session
=> {"_csrf_token"=>"1yAn0jI4VWzUH84PNTH0lVhjpY98e9echQGS4=", "session_id"=>"89984667d30d0fec71f2a5cbb9017e24"}

I've tried everything I can think of to try to get to current_user via app
and app.session, but no luck. How can I access current_user?


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/nCXP5A2bym0J.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMar 5, '12 at 6:59p
activeMar 5, '12 at 6:59p
posts1
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Don: 1 post

People

Translate

site design / logo © 2022 Grokbase