[英]Cancel button for google plus sign-in
In twitter when the user pressed the cancel button it is redirected to this URL: 在Twitter中,当用户按下“取消”按钮时,它将重定向到以下URL:
URL/verify?denied=TOKEN
therefore you can determine it by the denied
in the URL. 因此您可以通过URL中的
denied
来确定它。
In google+ sign-in, is there a way to detect the cancel button in the sign-in page or detect the close button for the javascript or jquery? 在google +登录中,有没有办法检测登录页面中的“取消”按钮或检测javascript或jquery的关闭按钮?
In the callback function, an error code is returned if the user rejects the consent dialog. 在回调函数中,如果用户拒绝同意对话框,则会返回错误代码。
An example callback that checks for access_denied, indicating the user rejected the consent dialog: 一个示例回调,它检查access_denied,指示用户拒绝了同意对话框:
function onSignInCallback(authResult) {
if (authResult['access_token']) {
// success
} else if (authResult['error']) {
if (authResult['error'] == 'immediate_failed'){
// This is perfectly normal, the user reached the site and was not logged in
// However, if the user should be signed in on this page, it would be
// appropriate to have an error here
}
if (authResult['error'] == 'access_denied'){
// The user cancelled out of the dialog.
}
// There was an error, which means the user is not signed in.
// As an example, you can handle by writing to the console:
console.log('There was an error: ' + authResult['error']);
}
console.log('authResult', authResult);
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.