I have the following code on my login page, login is triggered on click of the login button:
export async function login() {
let email = $w("#inputEmail").value;
let password = $w("#inputPass").value;
try {
await authentication.login(email, password);
wixLocation.to("/viewuserrequests");
} catch (e) {
console.log(e);
}
}
The following logs an error to the dev console “ailed to parse redirect url: Error: Authorization redirect url missing
at G (utils.ts:422:9)
at w (utils.ts:389:28)
at b (utils.ts:376:29)
at login (siteMembersApi.ts:1623:24)
at async login (siteMembersSdkProvider.ts:47:13)
at async AsyncFunction. (platformWorkerInitializer.ts:59:13)”
When using the wixLocationFrontend.to() the page does not even change.
Is this a bug ? (I’m currently using a free site)
I’ve also tried to use:
" authentication.onLogin(() => { wixLocation.to(“/viewuserrequests”);})"
but get the same error.
Login is successful, otherwise catch() will be executed.
I’m testing a live site (not preview) but I do not have a domain (free wix plan).
I believe that since the target URL is a member page, wixLocationFrontend.to(“”) need to pass the auth token and I think this is the issue.
I have the same login logic in Editor-X on a premium site and using wixUsers instead of authenticate and it does not produce this error. I’ve tried using wixUser here as well and it still produce the same error.