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

Refactor to Mixin #2

Open
mbleigh opened this issue Apr 16, 2009 · 3 comments
Open

Refactor to Mixin #2

mbleigh opened this issue Apr 16, 2009 · 3 comments

Comments

@mbleigh
Copy link
Owner

mbleigh commented Apr 16, 2009

Make the TwitterAuth functionality a mixin instead of a superclass, so that TwitterAuth can be more configurable and added in a less strict manner.

Example:

```
class User < ActiveRecord::Base
twitter_authenticated :via => :oauth
end
```

@bjeanes
Copy link

bjeanes commented Apr 18, 2009

This is perfect for those of us wanting to add twitter login as an optional way to authenticate, in addition to traditional login with username and password

@mbleigh
Copy link
Owner Author

mbleigh commented Apr 18, 2009

Ok, this is something I’d like to tackle in the near future. This is my proposed laundry list, tell me if I’m missing anything:
- Allow TwitterAuth to be added to a model via a `twitter_authenticated` mixin
- Allow enough configuration to keep it from conflicting with other authentication solutions. (I might namespace all of the functionality into a proxied twitter object that does more than the current dispatcher).
- Remove the validations from being required (this way apps that don’t solely use TwitterAuth can have blank fields for some of those fields).
- Support legacy versions of TwitterAuth by making the GenericUser automatically call `twitter_authenticated`
- Tweak the generator to take advantage of the new refactor.

Obviously this isn’t a small task and I’ll be starting work on it in a `mixin` branch sometime soon.

@micahalcorn
Copy link

Any progress on this? I am also having trouble getting my application to logout. I understand that I can use the /logout path from the sessions controller, but it does not actually sign out of twitter after destroying the session. As a result, I just end up looping back through the automatic login. Any suggestions?

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

3 participants