fix(12): WR-03 follow-up - fix TS type narrowing on token return
This commit is contained in:
parent
1bb2b8b0a2
commit
be6f07b8c9
1 changed files with 3 additions and 2 deletions
|
|
@ -58,9 +58,10 @@ export class Pax8Client {
|
|||
if (!data.access_token || typeof data.expires_in !== 'number') {
|
||||
throw new Error('PAX8 token response missing access_token/expires_in');
|
||||
}
|
||||
this.accessToken = data.access_token;
|
||||
const token: string = data.access_token;
|
||||
this.accessToken = token;
|
||||
this.tokenExpiry = Date.now() + data.expires_in * 1000;
|
||||
return this.accessToken;
|
||||
return token;
|
||||
}
|
||||
|
||||
// Phase 11/12 will extend this with 429-aware Retry-After backoff for the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue