Skip to content

Commit 551a6fb

Browse files
fix(local scheme): fix behaviour when token is not required (#951)
1 parent 4014627 commit 551a6fb

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/schemes/local.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export class LocalScheme<
9999
const token = this.token.sync()
100100

101101
// Token is required but not available
102-
if (this.options.token.required && !token) {
102+
if (!token) {
103103
return response
104104
}
105105

@@ -248,13 +248,11 @@ export class LocalScheme<
248248
}
249249

250250
protected updateTokens(response: HTTPResponse): void {
251-
if (this.options.token.required) {
252-
const token = getResponseProp(
253-
response,
254-
this.options.token.property
255-
) as string
256-
this.token.set(token)
257-
}
251+
const token = this.options.token.required
252+
? (getResponseProp(response, this.options.token.property) as string)
253+
: true
254+
255+
this.token.set(token)
258256
}
259257

260258
protected initializeRequestInterceptor(): void {

0 commit comments

Comments
 (0)