简体   繁体   English

使用Instagram API注销后如何重定向到主页

[英]How we can redirect back to home page after logout with Instagram API

I'm using Instagram API for login with Instagram without Signup.The issue is that how I can log out from Instagram from my website and redirect back to my website home page. 我正在使用Instagram API进行没有注册的Instagram登录问题是如何从我的网站从Instagram注销并重定向回我的网站主页。 If I will use this link as a href in Log out button https://instagram.com/accounts/logout then Instagram will be logged out but How I will redirect back to my website home page. 如果我将这个链接用作注销按钮https://instagram.com/accounts/logout中的href,那么Instagram将被注销,但我将如何重定向回我的网站主页。 I m also using Facebook API for login and its provide me logout URL, when I will click on it then it will log out facebook account and then after this, it redirects back to my website homepage. 我也在使用Facebook API进行登录,它提供了我的注销URL,当我单击它时,它将注销Facebook帐户,然后此后,它重定向回到我的网站主页。

instead of opening the logout URL, use javascript to append an hidden iframe with logout URL: 而不是打开注销URL,请使用javascript将隐藏的iframe附加到注销URL:

$(document).append('<div style="display:none"><iframe src="https://instagram.com/accounts/logout/" width="0" height="0"></iframe></div>');

this will logout of instagram and then show login button. 这将注销instagram,然后显示“登录”按钮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM