谷歌帐户注销和重定向 [英] google account logout and redirect

查看:30
本文介绍了谷歌帐户注销和重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 openid 登录用户.(仅限谷歌帐户).现在我的页面中有一个注销链接,单击该链接后,我希望用户从 google 帐户注销,并将页面重定向到我的主页.这可以吗??

I am using openid to log the user in.(google account only). Now I have a sign out link in my page, which on clicking, I want the user to be logged out of google accounts and the page to be redirected to my home page. can this be done ??

编辑-
更改已接受的答案,因为现在 Google 允许将 [继续] 重定向到您想要的任何域.

Edit-
Changing the accepted answer because now Google allows redirecting [continuing] to any domain you want.

推荐答案

我已经解决了这个问题,当用户点击注销链接时调用这个函数:

I have solved this issue calling this function when the user click on the logout link:

var logout = function(){
document.location.href = "https://www.google.com/accounts/Logout?continue=https://appengine.google.com/_ah/logout?continue=http://www.example.com";
}

当用户点击链接时,浏览器将用户重定向到注销页面,只有当注销完成时,用户才会被重定向到站点http://www.example.com".

When the user click on the link, the browser redirect the user to the logout page and only when the logout is complete, the user is redirected to the site "http://www.example.com".

我希望这能有所帮助.

这篇关于谷歌帐户注销和重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆