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

Using with both an auto-create model, and non-auto-create model #54

Open
joraff opened this issue Sep 19, 2012 · 4 comments
Open

Using with both an auto-create model, and non-auto-create model #54

joraff opened this issue Sep 19, 2012 · 4 comments

Comments

@joraff
Copy link
Contributor

joraff commented Sep 19, 2012

Hi there,

I have a particular need to use CAS to authenticate two different user models in an app, say a user and an admin. The user objects can be auto-created, however, the admin objects need to exist already.

Could a discussion be started on how you think this could be handled? Perhaps adding a :create_user => true|false to devise :cas_authenticatable?

@nbudin
Copy link
Owner

nbudin commented Sep 19, 2012

That's an interesting use case, and definitely seems reasonable to me.

Unfortunately, we can't currently add a :create_user option to devise_for, because devise_cas_authenticatable supports Devise 1.0 in order to work on Rails 2.3 apps. But it may be time to finally break that support. People can still use old versions of this gem.

The other thing we could do that seems non-awful is allow you to define a class method called, say, create_cas_users?. If defined, this would override the default behavior from the Devise configuration.

I honestly don't have a strong preference which way to go. Opinions welcome.

@joraff
Copy link
Contributor Author

joraff commented Sep 19, 2012

That was going to be my second suggestion, similar to cas_extra_attributes=.

Did you mean to write devise_for, as in the route generator?

@nbudin
Copy link
Owner

nbudin commented Sep 19, 2012

No, sorry - I has a brains. :) Any preference which way to go?

@joraff
Copy link
Contributor Author

joraff commented Sep 19, 2012

My vote is still for in the module selector, I think that's much cleaner :) But it will probably be easier to implement using a method and doesn't break Devise 1.0 compatibility.

Github's job queue is borked at the moment - I'll put some stuff in my fork once it's created.

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