🎨 Lint and prettify twitch.ts

This commit is contained in:
RaviAnand Mohabir 2021-05-26 00:01:27 +02:00
parent 615ff5fee3
commit 5e674c30ee

View File

@ -1,5 +1,4 @@
import { OAuth2Provider, OAuth2ProviderConfig } from "./oauth2";
import { ucFirst } from "../helpers";
export interface TwitchProfile {
id: string;
@ -47,11 +46,13 @@ export class TwitchOAuth2Provider extends OAuth2Provider<
async getUserProfile(tokens: TwitchTokens): Promise<TwitchProfile> {
const headers = {
'Client-ID': this.config.clientId + '',
'Accept': 'application/vnd.twitchtv.v5+json',
'Authorization': `Bearer ${tokens.access_token}`
"Client-ID": this.config.clientId + "",
Accept: "application/vnd.twitchtv.v5+json",
Authorization: `Bearer ${tokens.access_token}`,
};
const { data: [profile] } = await fetch(this.config.profileUrl!, { headers: headers }).then(res => res.json())
return profile
const {
data: [profile],
} = await fetch(this.config.profileUrl!, { headers: headers }).then((res) => res.json());
return profile;
}
}