Skip to content

Commit 8dc4cca

Browse files
committed
Drop Empty auth header request
1 parent d5fb328 commit 8dc4cca

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

sdk/src/platform/Platform.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,12 @@ export default class Platform extends EventEmitter {
711711

712712
await this.ensureLoggedIn();
713713

714+
// Validate token before sending request
715+
const authData = await this._auth.data();
716+
if (!authData?.access_token || authData?.access_token?.trim() === '') {
717+
throw new Error('Access token is empty. Please login before making API requests.');
718+
}
719+
714720
request.headers.set('Client-Id', this._clientId);
715721
if (!this._authProxy) {request.headers.set('Authorization', await this.authHeader());}
716722

0 commit comments

Comments
 (0)