This commit is contained in:
@@ -40,7 +40,7 @@ export class SugoiAuthProvider implements AuthProvider {
|
||||
*
|
||||
* https://dev.twitch.tv/docs/authentication/getting-tokens-oauth/#get-the-user-to-authorize-your-app
|
||||
*/
|
||||
async getAuthorization(...scopes: string[]): Promise<void> {
|
||||
async getAuthorization(...scopes: string[]): Promise<AccessTokenWithUserId> {
|
||||
const token = await this.#token
|
||||
if(!token) return this.#authorize(scopes)
|
||||
for (const scope of scopes) {
|
||||
@@ -48,6 +48,7 @@ export class SugoiAuthProvider implements AuthProvider {
|
||||
return this.#authorize(scopes)
|
||||
}
|
||||
}
|
||||
return getTwurpleProxy(token)
|
||||
}
|
||||
getCurrentScopesForUser(user: UserIdResolvable):string[] {
|
||||
if (!this.#token || this.#token instanceof Promise) throw new Error("unauthorized")
|
||||
|
||||
Reference in New Issue
Block a user