Closed (won't fix)
Project:
Services
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
4 May 2011 at 15:26 UTC
Updated:
12 Oct 2012 at 17:05 UTC
Jump to comment: Most recent file
If a user is automatically logged in after they register ("Require e-mail verification when a visitor creates an account" is not enabled in user settings) the user.register action should return the user's session to save an extra login call.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | user_register-1146896-10.patch | 2.35 KB | dabblela |
| #7 | user_register-1146896-7.patch | 2.31 KB | dabblela |
| #1 | user_register-1146896-1.patch | 1.04 KB | dabblela |
Comments
Comment #1
dabblela commentedPatch attached
Comment #2
marcingy commentedI disagree each resource should perform a specific function, so you do a registation followed by a login. This ensures that the client is robust to any changes on the server side.
Comment #3
dabblela commentedI should add I'm working in the D6 branch for my project but I should be able to forward port this to D7 without much trouble if it looks OK.
Comment #4
marcingy commentedThis is a feature request as well not a bug.
Comment #5
dabblela commentedI see what you mean, but if user settings are set for immediate login, the resource is already performing the login function, just not telling the client about it. Forcing duplicate login calls seems like it could lead to unintended behaviors with implementations of hook_user that act on login.
Comment #6
marcingy commentedI see where you are coming from as well. Let me have a think about this, might be worth speaking to Kyle too about this.
Comment #7
dabblela commentedAs per the discussion in IRC, please see attached.
Comment #8
marcingy commentedFrom a quick scan on my part this looks good, I suppose it would be good if we had tests for this. I'll try the patch locally later against on d7.
Comment #9
voxpelli commentedSome feedback on the patch - sorry for being nitpicky ;)
Rename "returnUser" to something more descriptive, like "returnSession" or just "session"?
Modify to something like: "If true, a session for the user will be returned if possible."
Change the name of $new_user to something more descriptive - like $result.
Why do we need to regenerate the session here? If the user is logged in then the session regeneration will already have been dealt with elsewhere?
Why is this removed in this patch? Seems to be outside of any of the other code touched by this patch?
Powered by Dreditor.
Comment #10
dabblela commentedPatch attached. As for removing the return at the end, according to the if/else flow in the function (original and w/ this patch) there's no way the full user ever gets returned.
Comment #11
dabblela commentedComment #12
marcingy commentedNot sure if it is just me but it appears as nothing is being returned by the resource now?
Comment #13
kylebrowning commentedThis should actually be applied to the register method now as that is the form of registering a user, not the create method.
Comment #14
kylebrowning commentedNO workin patch, re-open if you get one.