mirror of
https://github.com/Dan6erbond/sk-auth.git
synced 2024-11-20 19:07:20 +01:00
🎨 Lint and prettify twitch.ts
This commit is contained in:
parent
615ff5fee3
commit
5e674c30ee
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user