我正在使用Instagram API,用户可以使用他们的帐户登录,我可以将他们的访问令牌用于所有端点。用户登录后,在浏览器会话中存在。如何为用户提供在Instagram帐户之间切换的选项。
登录 - > 1个帐号 - >切换帐户 - >由于之前的会话,它再次使用相同的帐户登录而未经确认。
这是什么解决方案?
答案 0 :(得分:2)
You have logout from instagram. Opening URL "https://instagram.com/accounts/logout/"
will log user out of instagram.
You have to do this before you give this option to login again
One way I did it on https://www.picodash.com was to open a hidden iframe
with this URL and it will logout, (jquery code)
$('#content').append('<div style="display:none"><iframe src="https://instagram.com/accounts/logout/" width="0" height="0"></iframe></div>');
So when give the option to add second account, run the above code before you allow the user to click login button