Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76cd0649b1 | ||
|
|
e3c12df6fb |
Vendored
-5
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"files.associations": {
|
|
||||||
"wrangler.json": "jsonc"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user