You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 3, 2022. It is now read-only.
Some APIs require authentication using a query parameter in the URL. For example, the Clubhouse API has examples that look like this:
curl -X GET \
-H "Content-Type: application/json" \
-L "https://api.clubhouse.io/api/v3/member?token=$CLUBHOUSE_API_TOKEN"
To resolve this issue, auth.ts should define and export a class that can handle automatically attaching a token to the query parameters in the URL. For example:
exportclassQueryParamHandlerimplementsifm.IRequestHandler{param: stringtoken: string;constructor(token: string,param="token"){this.token=token;this.param=param;}prepareRequest(options:any): void{// not sure where to find request URL, so this is pseudocode...if(this.url.contains("?")){this.url+=`&${this.param}=${this.token}`;}else{this.url+=`?${this.param}=${this.token}`;}}}