Closed (fixed)
Project:
Services
Version:
7.x-3.5
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
30 Aug 2013 at 14:54 UTC
Updated:
11 May 2014 at 04:01 UTC
Jump to comment: Most recent
Hi,
I have a problem with services, when I would like to login just after I register a user. I've got an error "Wrong username or password ...". When I modify the password in the admin, the problem doesn't appear. :/
I made that
var data = {
"name": "test",
"mail": "test@test.fr",
"pass": "test",
"status": 1
}
jQuery.ajax({
type: "POST",
url: "http://duppp.local/api/1.0/user/register",
dataType: 'json',
data: JSON.stringify(data),
contentType: 'application/json',
success: function(data) {
console.log(data);
},
error: function(data) {
console.log(data);
}
});
Comments
Comment #1
ygerasimov commentedThanks for bringing this point out. The thing is if you are anonymous user and register a user your register form does not have password field at all. It has only username and email fields. All instructions are sent by email (with token to log in and set the password). So register call actually does not set the password.
I have cleaned up tests to remove passing password.
If you need to allow anonymous user to set their password during registration you need to use some contrib module. For example https://drupal.org/project/user_registrationpassword (but I haven't tested it).
Comment #2
atu commentedThanks for your quick answer. I will try this module https://drupal.org/project/user_registrationpassword and I will tell you if it's working or not ;)
Comment #4
mstrelan commentedWhat about when admins create new users, eg by logging in via OAuth2? We still have to user the user/register resource but the password is now cleared! Should I open a new issue?
Comment #5
justinen commentedmstrelan - I'm also having this issue with admins creating users. Did you create a new issue for this? I wasn't able to find it anywhere in the issue queue. I'm using version 7.x-3.7
Comment #6
mstrelan commentedNo, I didn't create a new issue.
Comment #7
justinen commentedDo you have any suggestions for a fix/workaround? Thanks.
Comment #8
mstrelan commentedActually I can't remember what I did since I didn't build the app, just the Drupal site. It was either resolved by using user_registrationpassword, or I may have told the developer to create the user then update it immediately after with the password submitted in the user creation/registration form.
Comment #9
justinen commentedThis patch fixed my issue: https://drupal.org/files/issues/user_create-2198005-1.patch