File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed
Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export default class LocalScheme {
3535 }
3636
3737 // Ditch any leftover local tokens before attempting to log in
38- await this . _logoutLocally ( )
38+ await this . $auth . reset ( )
3939
4040 const result = await this . $auth . request (
4141 endpoint ,
@@ -93,16 +93,20 @@ export default class LocalScheme {
9393 . catch ( ( ) => { } )
9494 }
9595
96- // But logout locally regardless
97- return this . _logoutLocally ( )
96+ // But reset regardless
97+ return this . $auth . reset ( )
9898 }
9999
100- async _logoutLocally ( ) {
100+ async reset ( ) {
101101 if ( this . options . tokenRequired ) {
102102 this . _clearToken ( )
103103 }
104104
105- return this . $auth . reset ( )
105+ this . $auth . setUser ( false )
106+ this . $auth . setToken ( this . name , false )
107+ this . $auth . setRefreshToken ( this . name , false )
108+
109+ return Promise . resolve ( )
106110 }
107111}
108112
Original file line number Diff line number Diff line change @@ -67,9 +67,14 @@ export default class Oauth2Scheme {
6767 this . $auth . ctx . app . $axios . setHeader ( this . options . tokenName , false )
6868 }
6969
70- async logout ( ) {
70+ async reset ( ) {
7171 this . _clearToken ( )
72- return this . $auth . reset ( )
72+
73+ this . $auth . setUser ( false )
74+ this . $auth . setToken ( this . name , false )
75+ this . $auth . setRefreshToken ( this . name , false )
76+
77+ return Promise . resolve ( )
7378 }
7479
7580 login ( { params, state, nonce } = { } ) {
You can’t perform that action at this time.
0 commit comments