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

STI & devise scope. #57

Open
azraai opened this issue Nov 9, 2012 · 1 comment
Open

STI & devise scope. #57

azraai opened this issue Nov 9, 2012 · 1 comment

Comments

@azraai
Copy link

azraai commented Nov 9, 2012

Right now I'm having a problem logging in with STI models. My app has 3 different model namely User, Staff, and Admin. User is the base model. Every model has different scope to access.

Currently, only User is able to sign in using CAS. The other is having problem after logging in at the CAS server. For Admin & Staff models the app return Invalid Email & Password error after signing in from the CAS server.

I believe this has something to do with the file lib/devise_cas_authenticatable/strategy.rb. I just can't figure out where is the problem really is.

Anyone has clues or leads on this problem.

@nbudin
Copy link
Owner

nbudin commented Dec 7, 2012

Hi Ariff, so sorry for not getting back to you until now!

If you're getting the Invalid Email & Password message, that sounds like the CAS strategy isn't being triggered at all (because that message comes from the database_authenticatable strategy). My guess would be that the valid? method is returning false.

Like you, I'm not sure why this would be the case, but maybe what's going on is that your model subclasses aren't inheriting the authenticate_with_cas_ticket method from the mixin. Can you make sure that all of the subclasses have that method?

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

2 participants