Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Allow scope to be changed #23

Open
BRMatt opened this issue Nov 20, 2011 · 3 comments
Open

Allow scope to be changed #23

BRMatt opened this issue Nov 20, 2011 · 3 comments

Comments

@BRMatt
Copy link

BRMatt commented Nov 20, 2011

At the moment the controllers reference current_user and authenticate_user! but our application uses a model called Member instead of User.

The Devise registration controller has a small helper that handles this nicely

BRMatt added a commit to BRMatt/devise_oauth2_providable that referenced this issue Nov 22, 2011
BRMatt added a commit to BRMatt/devise_oauth2_providable that referenced this issue Nov 29, 2011
BRMatt added a commit to BRMatt/devise_oauth2_providable that referenced this issue Dec 4, 2011
This commit removes the rails engine routes and introduces a
devise_oauth_for helper which constructs the necessary routes.

Benefits of this change:

* Can now have more than one oauth endpoint per app
* Can now safely override controllers
* All current tests are now passing!

Although there are tests for some aspects of the new routing system,
they're not 100% comprehensive and don't cover the authenticate_scope! method
BRMatt added a commit to BRMatt/devise_oauth2_providable that referenced this issue Dec 12, 2011
BRMatt added a commit to BRMatt/devise_oauth2_providable that referenced this issue Dec 12, 2011
BRMatt added a commit to BRMatt/devise_oauth2_providable that referenced this issue Dec 12, 2011
BRMatt added a commit to BRMatt/devise_oauth2_providable that referenced this issue Dec 12, 2011
BRMatt added a commit to BRMatt/devise_oauth2_providable that referenced this issue Dec 12, 2011
BRMatt added a commit to BRMatt/devise_oauth2_providable that referenced this issue Dec 18, 2011
The bug in question was that AR was complaining about it had received
an object of type Client when it expected one of type Client.

Essentially this bug is caused when the Client model is loaded at some point in execution
then reloaded later on, redefining the class with the same name, but different #object_id

In this instance the Client class was being loaded via the routes.rb file when
`devise_oauth_for` created a mapping object which constantized all the model names,
causing Rails to load them all.

Solution is to only constantize them on demand. It also makes the syntax more managable.

Refs socialcast#23
@barbolo
Copy link

barbolo commented Mar 9, 2012

+1

@adamburmister
Copy link

+1

Has this work ever been completed?

@explosis
Copy link

This would be nice since using a model not named "User" breaks oauth2_providable_strategy

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants