mirror of
https://github.com/Dan6erbond/sk-auth.git
synced 2024-11-25 19:05:46 +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 { OAuth2Provider, OAuth2ProviderConfig } from "./oauth2";
|
||||||
import { ucFirst } from "../helpers";
|
|
||||||
|
|
||||||
export interface TwitchProfile {
|
export interface TwitchProfile {
|
||||||
id: string;
|
id: string;
|
||||||
@ -47,11 +46,13 @@ export class TwitchOAuth2Provider extends OAuth2Provider<
|
|||||||
|
|
||||||
async getUserProfile(tokens: TwitchTokens): Promise<TwitchProfile> {
|
async getUserProfile(tokens: TwitchTokens): Promise<TwitchProfile> {
|
||||||
const headers = {
|
const headers = {
|
||||||
'Client-ID': this.config.clientId + '',
|
"Client-ID": this.config.clientId + "",
|
||||||
'Accept': 'application/vnd.twitchtv.v5+json',
|
Accept: "application/vnd.twitchtv.v5+json",
|
||||||
'Authorization': `Bearer ${tokens.access_token}`
|
Authorization: `Bearer ${tokens.access_token}`,
|
||||||
};
|
};
|
||||||
const { data: [profile] } = await fetch(this.config.profileUrl!, { headers: headers }).then(res => res.json())
|
const {
|
||||||
return profile
|
data: [profile],
|
||||||
|
} = await fetch(this.config.profileUrl!, { headers: headers }).then((res) => res.json());
|
||||||
|
return profile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user