Hello! I’m using Wix Editor on Windows. I want to build a custom login form using a regular page, instead of the LIghtbox Login form offered by Wix.
I’m getting an error message though, and I’ve found out the error message is generated by a specific line of code, so I can isolate the code to a single line and I’m still getting the same error.
This is the line of code:
wixUsers.login(email,password);
Both email and password are correct. This is the error message:
Failed to parse redirect url: Error: Authorization redirect url missing
at B (utils.ts:491:9)
at G (utils.ts:458:28)
at M (utils.ts:446:29)
at Object.handleLoginResponse (siteMembersApi.ts:647:4)
at login (siteMembersApi.ts:412:35)
at async login (siteMembersSdkProvider.ts:48:13)
at async AsyncFunction. (platformWorkerInitializer.ts:59:13)
I’ve been trying to figure out this for hours and getting a bit desperate now =D
Someone knows why this error message and how to solve it?
Thanks a lot in advance!
It is already good to see your OUTPUT, but what was your whole CODE for INPUT?
-
I already see that you are using a totaly old API-Version → Wix-Users, which already dies out and should not be used at all.
-
Instead use → Wix-Members-API.
Reconstruct your code one more time → using the current running API.
If you want to do so on backend…maybe an example for you…
import wixMembersBackend from 'wix-members-backend';
export function get_Token(email, password) {let data = {};
return wixMembersBackend.authentication.login(email, password)
.then((sessionToken)=> {
data.token = sessionToken;
data.approved = true;
return data;
})
.catch((error)=> {
data.original = error;
data.errCode = error.details.applicationError.code;
data.errText = error.details.applicationError.description;
data.token = undefined;
data.approved = false;
if(error.details.applicationError.code==='-19999') {data.errReason = 'email not found';}
if(error.details.applicationError.code==='-19956') {data.errReason = 'member blocked'; }
return data;
});
}
Even a little bit more advanced then the original one