2 Commits
Author SHA1 Message Date
sugoidogo 76cd0649b1 return token instead of void
docker.yml / build (push) Successful in 1m13s
2026-08-05 22:26:49 -07:00
sugoidogo e3c12df6fb remove editor config from repo 2026-08-05 22:25:00 -07:00
2 changed files with 2 additions and 6 deletions
-5
View File
@@ -1,5 +0,0 @@
{
"files.associations": {
"wrangler.json": "jsonc"
}
}
+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
*/
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")