Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Refactor to Mixin #2

Open
mbleigh opened this Issue · 3 comments

3 participants

@mbleigh
Owner

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

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
Owner

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

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
Something went wrong with that request. Please try again.