issue with params not actually being passed via UserSession constructor #22

Open
stephenhandley opened this Issue Jul 12, 2010 · 6 comments

Comments

Projects
None yet
4 participants
@stephenhandley

in the example app, the params for UserSessionsController#create are processed via

@user_session = UserSession.new(params[:user_session])

however the form in the example has the params bare. when i change them to be scoped via user_session things break.

I think that's because authlogic connect is not actually using the params passed to UserSession. It looks like it reads the params directly from the controller here:
AuthlogicConnect::Common::Variables#auth_params

@lancejpollard

This comment has been minimized.

Show comment Hide comment
@lancejpollard

lancejpollard Jul 12, 2010

Owner

I'll look into this, thanks.

Owner

lancejpollard commented Jul 12, 2010

I'll look into this, thanks.

@lancejpollard

This comment has been minimized.

Show comment Hide comment
@lancejpollard

lancejpollard Jul 14, 2010

Owner

can you describe the expected result/functionality? In the Rails 3 example app, params[:user_session] is nil, and the rest we handle in the background. What exactly are you trying to do?

Thanks.

Owner

lancejpollard commented Jul 14, 2010

can you describe the expected result/functionality? In the Rails 3 example app, params[:user_session] is nil, and the rest we handle in the background. What exactly are you trying to do?

Thanks.

@stephenhandley

This comment has been minimized.

Show comment Hide comment
@stephenhandley

stephenhandley Jul 14, 2010

yeah it seems odd that its being handled in the background as that breaks the interface expected with authlogic. seems like it would be clearer to pass the params through the UserSession constructor... at least expectation and the code in the controller seem to indicate that the call to the constructor would handle the params. otherwise it should just be @user_session = UserSession.new without any arguments. i'm trying to find a way to handle passing login/email/password so we can support traditional login in parallel with oauth/openid.

yeah it seems odd that its being handled in the background as that breaks the interface expected with authlogic. seems like it would be clearer to pass the params through the UserSession constructor... at least expectation and the code in the controller seem to indicate that the call to the constructor would handle the params. otherwise it should just be @user_session = UserSession.new without any arguments. i'm trying to find a way to handle passing login/email/password so we can support traditional login in parallel with oauth/openid.

@lancejpollard

This comment has been minimized.

Show comment Hide comment
@lancejpollard

lancejpollard Jul 14, 2010

Owner

cool, makes sense. There's a lot to clean up there. After realizing, with oauth, creating a user and "connecting with facebook" (aka creating a session) are basically one thing, I started just creating the user through the session (self.attempted_record = klass.new...). Makes it easier, but then this pops up :). Thanks for the help.

Lance

Owner

lancejpollard commented Jul 14, 2010

cool, makes sense. There's a lot to clean up there. After realizing, with oauth, creating a user and "connecting with facebook" (aka creating a session) are basically one thing, I started just creating the user through the session (self.attempted_record = klass.new...). Makes it easier, but then this pops up :). Thanks for the help.

Lance

@aac

This comment has been minimized.

Show comment Hide comment
@aac

aac Sep 8, 2010

Contributor

I'll add to this that options for the UserSession (particularly: remember_me) get lost in the OAuth process. Is there a good way to stash those options to be recovered when the handshake comes back?

-Andrew

Contributor

aac commented Sep 8, 2010

I'll add to this that options for the UserSession (particularly: remember_me) get lost in the OAuth process. Is there a good way to stash those options to be recovered when the handshake comes back?

-Andrew

@jkale

This comment has been minimized.

Show comment Hide comment
@jkale

jkale Jan 21, 2011

I'd second this. I've got multiple users for one Account in my app so I need to pass the account record in so I can relate the two but because the params get over-written I can't.

Rich

jkale commented Jan 21, 2011

I'd second this. I've got multiple users for one Account in my app so I need to pass the account record in so I can relate the two but because the params get over-written I can't.

Rich

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment