File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -297,16 +297,20 @@ public function logout($globalLogout=true)
297297 if ($ globalLogout )
298298 Yii::$ app ->user ->logout ();
299299
300- if ($ identity != null && !empty ($ identity ->sid ))
301- {
302- $ token = $ this ->getAccessToken ()->token ;
303- $ headers = [
304- 'Authorization ' => 'Bearer ' . $ token
305- ];
306- $ params = [
307- 'sid ' => $ identity ->sid
308- ];
309- $ this ->api ($ this ->logoutUrl , 'GET ' , $ params , $ headers );
300+ try {
301+ if ($ identity != null && !empty ($ identity ->sid ))
302+ {
303+ $ token = $ this ->getAccessToken ()->token ;
304+ $ headers = [
305+ 'Authorization ' => 'Bearer ' . $ token
306+ ];
307+ $ params = [
308+ 'sid ' => $ identity ->sid
309+ ];
310+ $ this ->api ($ this ->logoutUrl , 'GET ' , $ params , $ headers );
311+ }
312+ } catch (Exception $ e ) {
313+ Yii::$ app ->response ->redirect (Yii::$ app ->getHomeUrl ());
310314 }
311315 return true ;
312316 }
You can’t perform that action at this time.
0 commit comments