the function user_external_login_register is great but the developper doesn't know which operation has been performed. Like drupal_write_record, this function should return USER_CREATED or USER_LOGGED_IN in order to perform other operations after login.
For instance you can create a row for an OAuth token if user is created, but only update the token if user already exists. I think this is a bug in the API since this function provides two distinct functionnalities but doesn't provides any information on which one was effectively processed. Does it makes sense ?
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | issue990800.patch | 1.18 KB | sylvain lecoy |
Comments
Comment #1
sylvain lecoy commentedAttached a patch proposing a solution.
Comment #2
damien tournoud commentedWell, I consider this function deprecated, and it sends the wrong message.
See http://api.drupal.org/api/drupal/modules--openid--openid.module/function... for a correct implementation of the same process.
Comment #3
sylvain lecoy commentedOops yes you right, swap USER_CREATED and USER_LOGGED_IN in the patch provided.
Why this function is deprecated ? It seems a new function but you say it's already deprecated ?
So you mean instead of using build in function, we need to write our own function like in the openid module for each module which implements an external authentication ?
Comment #4
sylvain lecoy commentedHere is my implementation for OAuth based authentication. As this routine delegate implementation to a concrete consumer module, this can serve as a base to put in user module for external module as a tentative to unify the external logging API (ref http://drupal.org/node/817118#comment-4380390).
And here is the openid implementation:
That speaks volume about code duplication.
Comment #5
sylvain lecoy commentedtagging it
Comment #6
traviscarden commentedRe-tagging.