Account Linking Failed

坚强是说给别人听的谎言 提交于 2020-01-05 07:30:34

问题


When user hits account linking button, it opens a new window. Is that ok ?

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.

That's ok.

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);

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];
            }
        }
    };

Then :

My redirect url :

 var r2 = redirect_uri + "=" + account_linking_token + "&authorization_code=" + response.message; 

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

.

Any help?


回答1:


Make sure that you are subscribing to the messaging_account_linking event.



来源:https://stackoverflow.com/questions/43234206/account-linking-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!