File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -150,9 +150,9 @@ export default class Auth {
150
150
151
151
reset ( ) {
152
152
if ( ! this . strategy . reset ) {
153
- this . setUser ( null )
154
- this . setToken ( this . $state . strategy , null )
155
- this . setRefreshToken ( this . $state . strategy , null )
153
+ this . setUser ( false )
154
+ this . setToken ( this . $state . strategy , false )
155
+ this . setRefreshToken ( this . $state . strategy , false )
156
156
return Promise . resolve ( )
157
157
}
158
158
@@ -270,8 +270,7 @@ export default class Auth {
270
270
if ( ! _endpoint . headers ) {
271
271
_endpoint . headers = { }
272
272
}
273
-
274
- if ( ! _endpoint . headers [ 'Authorization' ] && isSet ( token ) ) {
273
+ if ( ! _endpoint . headers [ 'Authorization' ] && isSet ( token ) && token ) {
275
274
_endpoint . headers [ 'Authorization' ] = token
276
275
}
277
276
Original file line number Diff line number Diff line change @@ -156,6 +156,9 @@ export default class Storage {
156
156
const _key = this . options . localStorage . prefix + key
157
157
158
158
const value = localStorage . getItem ( _key )
159
+ if ( value === 'false' ) {
160
+ return false
161
+ }
159
162
160
163
return isJson ? JSON . parse ( value ) : value
161
164
}
@@ -195,7 +198,9 @@ export default class Storage {
195
198
196
199
const cookies = parseCookie ( cookieStr || '' ) || { }
197
200
const value = cookies [ _key ]
198
-
201
+ if ( value === 'false' ) {
202
+ return false
203
+ }
199
204
return isJson ? JSON . parse ( value ) : value
200
205
}
201
206
}
You can’t perform that action at this time.
0 commit comments