We have created a custom user registration form using the "user_register" form, and added our path (register/site) to the Secure Pages module. This will ensure the registration page is rendered using https. If the Username Originality AJAX Check module is enabled, the check never validates. The throbber next to the username field runs endlessly and never returns a success or failure.

Given the user registration form contains personal information such as email, username, and password, we would much prefer to secure the page if possible.

Comments

rat2008’s picture

Title: Username check does not validate when page is secure » Username check does not validate in my server
Version: 5.x-1.3 » 6.x-1.5
Assigned: Unassigned » rat2008
Priority: Normal » Critical

I have the same problem but I have drupal in a conventional server, the ajax reader sticks and does not return any value. but I have it mounted on a local server and works very well

wrightnow’s picture

Same problem for me - I'm sticking on both my local and live site. Since i'm running several other AJAX calls, I'm suspicious that this might be a module bug. Any progress on your end?

mrwhizkid’s picture

Same here. Definitely a bug in this module. The spinner just keeps spinning. Also, when I switch to 'manual' nothing shows up.

Duke Nukem’s picture

same problem for me too

deviantintegral’s picture

I was running into this issue as I had the devel module turned on, and was displaying memory usage and the page timer. Disabling those settings fixed the AJAX (and fixes quite a few other similar issues when dealing with AJAX and AHAH).

Rory’s picture

I'm also running into this issue, where I start typing and the ajax cycle won't complete. But I've noticed if I start typing in the username (allowing the ajax cycle to begin) then stop typing for a second or two and resume typing, the cycle will complete.

Anyone know why it doesn't complete the first time?

Prits’s picture

Hi everyone,
I was also facing the same issue , the issue was due to cross domain request. when we enable the secure pages the protocol changes to https but username_check module sends ajax request using http so browser rejects this request , and the cycle will not complete .
here is my quick solution to this :
line number 45 of username_check_auto.js
$.ajax({
// url: Drupal.settings.usernameCheck.ajaxUrl,
url: 'https://secure.myprop.com.au/username_check/isunique',
data: {username: Drupal.usernameCheckUsername},
dataType: 'json',

//this is hard coded url but can be made dynamic by checking secure pages module is enabled or not from the variables table .
http://drupalconcepts.blogspot.com
cheers

Rory’s picture

Previously, I had the Secure Pages module set to 'Make secure only the listed pages.' and beneath the checkbox I had listed URLs I wanted to deliver via https.

I changed it to 'Make secure every page except the listed pages.' so by default ALL my pages would deliver via https and any URLs I listed would not. Then I changed my list of URLs to:
*/autocomplete/*
*/ajax/*

This stopped the problem. Works for me with no noticeable delay. If any pages did load slower as a result of added https encryption, I would add their URLs to the list above to be excluded along with the ajax and autocomplete URLs.

Reevescorp’s picture

Solution:

In username_check.unique.inc at or around line 47

Change

print drupal_to_js($output);

to

print json_encode($output);

Why on Earth the author doesn't json encode his output for a jquery GET request that is expecting a json formatted output is beyond me.

In username_check_auto.js at or around line 46

Change

url: Drupal.settings.usernameCheck.ajaxUrl,

to

url:'/username_check/isunique',

That should solve any problem with the http/https issue.

Enjoy,

Reevescorp’s picture

PS

Go into your secure pages settings and add

username_check/isunique

to your list of secure pages.