Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Oauth 2.0 谷歌登录网站,Angular 2使用Typescript不';注销后不能工作_Oauth 2.0_Angular - Fatal编程技术网

Oauth 2.0 谷歌登录网站,Angular 2使用Typescript不';注销后不能工作

Oauth 2.0 谷歌登录网站,Angular 2使用Typescript不';注销后不能工作,oauth-2.0,angular,Oauth 2.0,Angular,完成此线程中的步骤后: 我可以在使用router.navigate()导航其他组件后成功登录Google。我使用的注销按钮如下: signOut() {var auth2 = gapi.auth2.getAuthInstance(); auth2.signOut().then(x=> {}).then(this._router.parent.navigate('Login'] )); 最后一个命令将我再次发送到登录组件,区别在于,如果我尝试再次登录,则不会发生任

完成此线程中的步骤后:

我可以在使用router.navigate()导航其他组件后成功登录Google。我使用的注销按钮如下:

signOut() {var auth2 = gapi.auth2.getAuthInstance();
           auth2.signOut().then(x=> {}).then(this._router.parent.navigate('Login'] )); 
最后一个命令将我再次发送到登录组件,区别在于,如果我尝试再次登录,则不会发生任何事情(不会调用on success函数),尽管在google developer控制台中,它显示正在检索令牌

access_token: "ya29.pgKa3wixEFbsLB-yUW2Mf3s8YvasRoM5javqTc9TxQgnW-  WUdxGD0CYyZj7p107e9w"
expires_in: 3600
希望你能帮助我

PD:正在进行登录过程的代码:

gapi.signin2.render(
   this.googleLoginButtonId,
   {
     "onSuccess": this.onGoogleLoginSuccess,
     "scope": "profile",
     "theme": "dark",
     "width": 240,
     "height": 50,
     "longtitle": true,
     'onfailure': this.onGoogleFailure
   });
提前谢谢