Authenticating oauth but not interactive #120

ephracis opened this Issue Jul 18, 2012 · 0 comments


None yet
1 participant

I have a controller where I want show and index to be accessible for everyone, but the rest should require authentication. However, I want to know if the user is logged in when they access show or index, so I can show personalized stuff for those who are authenticated.

I did this:

oauthenticate :except => [:show, :index]

This works fine for interactive stuff (using my browser). But when I try to access the show or index pages via an authenticated app using OAuth I don't get current_user set. current_token is set however but I would prefer it if current_user is set as well (to current_token.user).

I noticed that current_user does get set if I require oauthenticate, but when I don't then current_user is nil.

What am I doing wrong here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment