Can anyone explain how restful authentication works? I have the plugin working to an extent. The only thing I can''t do is logout. I''m assuming there are additional steps involved with adding methods to the users and sessions controllers due to the REST part. Anyone? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The way I understand the implementation of restful authentication, the act of "logging out" is to destroy (think CRUD) a Session resource. DELETE: http://example.com/sessions/:id On May 24, 3:11 pm, "John Lauck" <recaffeina...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Can anyone explain how restful authentication works? I have the plugin > working to an extent. The only thing I can''t do is logout. > > I''m assuming there are additional steps involved with adding methods to the > users and sessions controllers due to the REST part. > > Anyone?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
That''s how I understand the plugin as well. But shouldn''t certain methods fall back to general POST/GET request methods as well? I must be missing something, because I can''t specify the request method in an url. Can I? So, for instance to logout, link_to(''Logout'', :controller =>''sessions'', :action => ''destroy''), should allow a user to logout. Even if I could, it''s not supported by most web servers so there has to be a workaround. Does anyone know of any documentation on this plugin? John On 5/24/07, Robert Walker <rwalker348-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > The way I understand the implementation of restful authentication, the > act of "logging out" is to destroy (think CRUD) a Session resource. > > DELETE: http://example.com/sessions/:id > > On May 24, 3:11 pm, "John Lauck" <recaffeina...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Can anyone explain how restful authentication works? I have the plugin > > working to an extent. The only thing I can''t do is logout. > > > > I''m assuming there are additional steps involved with adding methods to > the > > users and sessions controllers due to the REST part. > > > > Anyone? > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 5/24/07, John Lauck <recaffeinated-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> That''s how I understand the plugin as well. But shouldn''t certain methods > fall back to general POST/GET request methods as well? > > I must be missing something, because I can''t specify the request method in > an url. Can I? So, for instance to logout, link_to(''Logout'', :controller > =>''sessions'', :action => ''destroy''), should allow a user to logout. Even if > I could, it''s not supported by most web servers so there has to be a > workaround.You can just create a route for it if you want. map.connect ''logout'', :controller => ''sessions'', :action => ''destroy'' -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
John, I took a closer look at this and found that what you need is already built into resful authentication. Take a look at this link: <%= link_to "Logout", session_path(session), :method => :delete %> And the route.rb: # Restful Authenticate routes map.resources :users, :sessions So you get the session_path(session) for free! On May 24, 3:58 pm, "Rick Olson" <technowee...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 5/24/07, John Lauck <recaffeina...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > That''s how I understand the plugin as well. But shouldn''t certain methods > > fall back to general POST/GET request methods as well? > > > I must be missing something, because I can''t specify the request method in > > an url. Can I? So, for instance to logout, link_to(''Logout'', :controller > > =>''sessions'', :action => ''destroy''), should allow a user to logout. Even if > > I could, it''s not supported by most web servers so there has to be a > > workaround. > > You can just create a route for it if you want. > > map.connect ''logout'', :controller => ''sessions'', :action => ''destroy'' > > -- > Rick Olsonhttp://lighthouseapp.comhttp://weblog.techno-weenie.nethttp://mephistoblog.com--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---