[SOLVED] Is your FORGOT PASSWORD feature working?

Wix tech support was most helpful in pointing out the problem - I then solved this little puzzle as follows.

Problem:
Running SITE code that prevents the Wix “forgot password” lightbox from running properly.

Fix:

Check to see if the page URL includes the “?forgotPassword” part.

To get the page URL:

import wixLocation from 'wix-location';
...
var pageURL = wixLocation.url;

The comparison string could look like this:

var forgotPasswordURL = "https://www.mysite.com?forgotPassword"

In the SITE code, check if the page URL includes the part “?forgotPassword”
You can do that with the slice() method, like this:

pageURL.slice(from, to);

The slice() method selects the elements starting at the given start argument, and ends at, but does not include, the given end argument.

https://www.mysite.com?forgotPassword  // sample url
0123456789012345678901234567890123456  // added to count characters

The sample URL above has 37 characters, so now you would know the boundaries for the slice() method, so the command would look something like this:

pageURL.slice(0,37);

Now you can check if the “forgot password” lightbox will be loaded, with something like this:

if( pageURL.slice(0, 37) === forgotPasswordURL) {
// The forgot password lightbox from Wix will be activated on this homepage.
// don't do the code that conflicts with the forgot password feature
}