return token instead of void
docker.yml / build (push) Successful in 1m13s

This commit is contained in:
2026-08-05 22:26:49 -07:00
parent e3c12df6fb
commit 76cd0649b1
+2 -1
View File
@@ -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 * 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 const token = await this.#token
if(!token) return this.#authorize(scopes) if(!token) return this.#authorize(scopes)
for (const scope of scopes) { for (const scope of scopes) {
@@ -48,6 +48,7 @@ export class SugoiAuthProvider implements AuthProvider {
return this.#authorize(scopes) return this.#authorize(scopes)
} }
} }
return getTwurpleProxy(token)
} }
getCurrentScopesForUser(user: UserIdResolvable):string[] { getCurrentScopesForUser(user: UserIdResolvable):string[] {
if (!this.#token || this.#token instanceof Promise) throw new Error("unauthorized") if (!this.#token || this.#token instanceof Promise) throw new Error("unauthorized")