I'm encountering an issue with referral points not being granted for certain users. For an administrative user (not UID 1), it works fine. I have started debugging a bit, and I've noticed that UID being used for the referrer does not always refer to a valid UID. For instance, I've seen the UID being logged as -1207959416 (where it should be 65).

Has anyone else seen this, or know what might be causing it?

Comments

handsofaten’s picture

Ah, of course right after I posted this I tracked down the problem, although I don't quite have a good solution yet.

The problem is that user login page is secure (https), and so the referral link is generated as https when the user lands on the My Account page right after login. For some reason, the https referral links don't work (sending the invalid UIDs to the userpoints api). If, after logging in, the user clicks on a "My Account" link, it pulls up the unencrypted version of the page, which generates a http version of the referral link. This version of the link works fine.