帐户关联失败 [英] Account Linking Failed
问题描述
当用户点击帐户链接按钮时,它将打开一个新窗口. 那样行吗 ?
When user hits account linking button, it opens a new window. Is that ok ?
然后,在该窗口中,我正在渲染带有帐户/密码字段的html页面. 当用户提供该凭据时,我将检入数据库并返回用户电子邮件(如果用户存在).
Than, in that window i'm rendering html page with account/password fields. When user provide that credentials, i'm checking in database and return user e-mail if user exists.
没关系.
我正在以这种方式创建重定向网址:
I'm creating redirect url this way :
var redirect_uri = getUrlParameter('redirect_uri');
console.log(redirect_uri);
var account_linking_token = getUrlParameter('account_linking_token');
console.log(account_linking_token);
我的getUrlParameter函数:
My getUrlParameter function :
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
};
然后:
我的重定向网址:
var r2 = redirect_uri + "=" + account_linking_token + "&authorization_code=" + response.message;
message.response是一封电子邮件.
message.response is an e-mail.
此处提到可以通过以下方式指定授权代码:开发人员.例如,用户名,电子邮件等.
Here is mentioned that authorization_code can be specified by developer. For example, username, email, etc.
最后,帐户链接失败.
At the end, account linking fails .
有帮助吗?
推荐答案
请确保您正在订阅messages_account_linking事件.
Make sure that you are subscribing to the messaging_account_linking event.
这篇关于帐户关联失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!