Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticating oauth but not interactive #120

Open
ephracis opened this issue Jul 18, 2012 · 0 comments
Open

Authenticating oauth but not interactive #120

ephracis opened this issue Jul 18, 2012 · 0 comments

Comments

@ephracis
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant