antarctic 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth.d.ts +1 -0
- package/dist/client.d.ts +1 -1
- package/dist/client.js +2 -2
- package/dist/oauth2.d.ts +1 -1
- package/dist/oauth2.js +4 -4
- package/dist/providers/42.js +2 -1
- package/dist/providers/amazon-cognito.d.ts +1 -1
- package/dist/providers/amazon-cognito.js +5 -4
- package/dist/providers/anilist.js +2 -1
- package/dist/providers/apple.js +2 -1
- package/dist/providers/atlassian.js +2 -1
- package/dist/providers/auth0.d.ts +1 -1
- package/dist/providers/auth0.js +5 -4
- package/dist/providers/authentik.d.ts +1 -1
- package/dist/providers/authentik.js +5 -4
- package/dist/providers/autodesk.d.ts +1 -1
- package/dist/providers/autodesk.js +5 -4
- package/dist/providers/battlenet.js +2 -1
- package/dist/providers/bitbucket.js +2 -1
- package/dist/providers/box.js +2 -1
- package/dist/providers/bungie.js +2 -1
- package/dist/providers/coinbase.js +2 -1
- package/dist/providers/discord.d.ts +1 -1
- package/dist/providers/discord.js +5 -4
- package/dist/providers/donation-alerts.js +2 -1
- package/dist/providers/dribbble.js +2 -1
- package/dist/providers/dropbox.js +2 -1
- package/dist/providers/epicgames.js +2 -1
- package/dist/providers/etsy.d.ts +1 -1
- package/dist/providers/etsy.js +5 -4
- package/dist/providers/facebook.js +2 -1
- package/dist/providers/figma.js +2 -1
- package/dist/providers/gitea.d.ts +1 -1
- package/dist/providers/gitea.js +5 -4
- package/dist/providers/github.js +2 -1
- package/dist/providers/gitlab.js +2 -1
- package/dist/providers/google.d.ts +1 -1
- package/dist/providers/google.js +5 -4
- package/dist/providers/intuit.js +2 -1
- package/dist/providers/kakao.js +2 -1
- package/dist/providers/keycloak.d.ts +1 -1
- package/dist/providers/keycloak.js +5 -4
- package/dist/providers/kick.d.ts +1 -1
- package/dist/providers/kick.js +5 -4
- package/dist/providers/lichess.d.ts +1 -1
- package/dist/providers/lichess.js +5 -4
- package/dist/providers/line.d.ts +1 -1
- package/dist/providers/line.js +5 -4
- package/dist/providers/linear.js +2 -1
- package/dist/providers/linkedin.js +2 -1
- package/dist/providers/mastodon.d.ts +1 -1
- package/dist/providers/mastodon.js +5 -4
- package/dist/providers/mercadolibre.d.ts +1 -1
- package/dist/providers/mercadolibre.js +5 -4
- package/dist/providers/mercadopago.d.ts +1 -1
- package/dist/providers/mercadopago.js +5 -4
- package/dist/providers/microsoft-entra-id.d.ts +1 -1
- package/dist/providers/microsoft-entra-id.js +5 -4
- package/dist/providers/myanimelist.d.ts +1 -1
- package/dist/providers/myanimelist.js +5 -4
- package/dist/providers/naver.js +2 -1
- package/dist/providers/notion.js +2 -1
- package/dist/providers/okta.d.ts +1 -1
- package/dist/providers/okta.js +5 -4
- package/dist/providers/osu.js +2 -1
- package/dist/providers/patreon.js +2 -1
- package/dist/providers/polar.d.ts +1 -1
- package/dist/providers/polar.js +5 -4
- package/dist/providers/reddit.js +2 -1
- package/dist/providers/roblox.d.ts +1 -1
- package/dist/providers/roblox.js +5 -4
- package/dist/providers/salesforce.d.ts +1 -1
- package/dist/providers/salesforce.js +5 -4
- package/dist/providers/shikimori.js +2 -1
- package/dist/providers/slack.js +2 -1
- package/dist/providers/spotify.d.ts +1 -1
- package/dist/providers/spotify.js +5 -4
- package/dist/providers/startgg.js +2 -1
- package/dist/providers/strava.js +2 -1
- package/dist/providers/synology.d.ts +1 -1
- package/dist/providers/synology.js +2 -2
- package/dist/providers/tiktok.d.ts +1 -1
- package/dist/providers/tiktok.js +5 -4
- package/dist/providers/tiltify.js +2 -1
- package/dist/providers/tumblr.js +2 -1
- package/dist/providers/twitch.js +2 -1
- package/dist/providers/twitter.d.ts +1 -1
- package/dist/providers/twitter.js +5 -4
- package/dist/providers/vk.js +2 -1
- package/dist/providers/withings.js +2 -1
- package/dist/providers/workos.d.ts +1 -1
- package/dist/providers/workos.js +5 -4
- package/dist/providers/yahoo.js +2 -1
- package/dist/providers/yandex.js +2 -1
- package/dist/providers/zoom.d.ts +1 -1
- package/dist/providers/zoom.js +5 -4
- package/package.json +1 -4
- package/readme.md +1 -1
package/dist/auth.d.ts
CHANGED
package/dist/client.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare class OAuth2Client {
|
|
|
5
5
|
private redirectURI;
|
|
6
6
|
constructor(clientId: string, clientPassword: string | null, redirectURI: string | null);
|
|
7
7
|
createAuthorizationURL(authorizationEndpoint: string, state: string, scopes: string[]): URL;
|
|
8
|
-
createAuthorizationURLWithPKCE(authorizationEndpoint: string, state: string, codeChallengeMethod: CodeChallengeMethod, codeVerifier: string, scopes: string[]): URL
|
|
8
|
+
createAuthorizationURLWithPKCE(authorizationEndpoint: string, state: string, codeChallengeMethod: CodeChallengeMethod, codeVerifier: string, scopes: string[]): Promise<URL>;
|
|
9
9
|
validateAuthorizationCode(tokenEndpoint: string, code: string, codeVerifier: string | null): Promise<OAuth2Tokens>;
|
|
10
10
|
refreshAccessToken(tokenEndpoint: string, refreshToken: string, scopes: string[]): Promise<OAuth2Tokens>;
|
|
11
11
|
revokeToken(tokenRevocationEndpoint: string, token: string): Promise<void>;
|
package/dist/client.js
CHANGED
|
@@ -23,7 +23,7 @@ export class OAuth2Client {
|
|
|
23
23
|
}
|
|
24
24
|
return url;
|
|
25
25
|
}
|
|
26
|
-
createAuthorizationURLWithPKCE(authorizationEndpoint, state, codeChallengeMethod, codeVerifier, scopes) {
|
|
26
|
+
async createAuthorizationURLWithPKCE(authorizationEndpoint, state, codeChallengeMethod, codeVerifier, scopes) {
|
|
27
27
|
const url = new URL(authorizationEndpoint);
|
|
28
28
|
url.searchParams.set("response_type", "code");
|
|
29
29
|
url.searchParams.set("client_id", this.clientId);
|
|
@@ -32,7 +32,7 @@ export class OAuth2Client {
|
|
|
32
32
|
}
|
|
33
33
|
url.searchParams.set("state", state);
|
|
34
34
|
if (codeChallengeMethod === CodeChallengeMethod.S256) {
|
|
35
|
-
const codeChallenge = createS256CodeChallenge(codeVerifier);
|
|
35
|
+
const codeChallenge = await createS256CodeChallenge(codeVerifier);
|
|
36
36
|
url.searchParams.set("code_challenge_method", "S256");
|
|
37
37
|
url.searchParams.set("code_challenge", codeChallenge);
|
|
38
38
|
}
|
package/dist/oauth2.d.ts
CHANGED
|
@@ -11,6 +11,6 @@ export declare class OAuth2Tokens {
|
|
|
11
11
|
scopes(): string[];
|
|
12
12
|
idToken(): string;
|
|
13
13
|
}
|
|
14
|
-
export declare function createS256CodeChallenge(codeVerifier: string): string
|
|
14
|
+
export declare function createS256CodeChallenge(codeVerifier: string): Promise<string>;
|
|
15
15
|
export declare function generateCodeVerifier(): string;
|
|
16
16
|
export declare function generateState(): string;
|
package/dist/oauth2.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { encodeBase64urlNoPadding } from "./encoding.js";
|
|
2
|
-
import * as sha2 from "@oslojs/crypto/sha2";
|
|
3
2
|
export class OAuth2Tokens {
|
|
4
3
|
data;
|
|
5
4
|
constructor(data) {
|
|
@@ -51,9 +50,10 @@ export class OAuth2Tokens {
|
|
|
51
50
|
throw new Error("Missing or invalid field 'id_token'");
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
|
-
export function createS256CodeChallenge(codeVerifier) {
|
|
55
|
-
const
|
|
56
|
-
|
|
53
|
+
export async function createS256CodeChallenge(codeVerifier) {
|
|
54
|
+
const data = new TextEncoder().encode(codeVerifier);
|
|
55
|
+
const digest = await crypto.subtle.digest("SHA-256", data);
|
|
56
|
+
return encodeBase64urlNoPadding(new Uint8Array(digest));
|
|
57
57
|
}
|
|
58
58
|
export function generateCodeVerifier() {
|
|
59
59
|
const randomValues = new Uint8Array(32);
|
package/dist/providers/42.js
CHANGED
|
@@ -12,7 +12,7 @@ export declare class AmazonCognito {
|
|
|
12
12
|
private auth;
|
|
13
13
|
constructor(options: AmazonCognitoOptions);
|
|
14
14
|
constructor(domain: string, clientId: string, clientSecret: string | null, redirectURI: string);
|
|
15
|
-
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL
|
|
15
|
+
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): Promise<URL>;
|
|
16
16
|
validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
|
|
17
17
|
refreshAccessToken(refreshToken: string, scopes: string[]): Promise<OAuth2Tokens>;
|
|
18
18
|
revokeToken(token: string): Promise<void>;
|
|
@@ -26,8 +26,8 @@ export class AmazonCognito {
|
|
|
26
26
|
this.tokenRevocationEndpoint = `https://${domain}/oauth2/revoke`;
|
|
27
27
|
this.userinfoEndpoint = `https://${domain}/oauth2/userInfo`;
|
|
28
28
|
}
|
|
29
|
-
createAuthorizationURL(state, codeVerifier, scopes) {
|
|
30
|
-
const url = this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
29
|
+
async createAuthorizationURL(state, codeVerifier, scopes) {
|
|
30
|
+
const url = await this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
31
31
|
return url;
|
|
32
32
|
}
|
|
33
33
|
async validateAuthorizationCode(code, codeVerifier) {
|
|
@@ -45,7 +45,7 @@ export class AmazonCognito {
|
|
|
45
45
|
const auth = requireAuthConfig(this.auth);
|
|
46
46
|
const state = generateOAuthState();
|
|
47
47
|
const codeVerifier = generateOAuthCodeVerifier();
|
|
48
|
-
const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
48
|
+
const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
49
49
|
await saveOAuthState(auth.store, state, { codeVerifier });
|
|
50
50
|
return url;
|
|
51
51
|
}
|
|
@@ -70,7 +70,8 @@ export class AmazonCognito {
|
|
|
70
70
|
profileString(claims["cognito:username"]) ??
|
|
71
71
|
profileString(claims.username),
|
|
72
72
|
email: profileString(claims.email),
|
|
73
|
-
image: profileString(claims.picture)
|
|
73
|
+
image: profileString(claims.picture),
|
|
74
|
+
raw: claims
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
77
|
}
|
package/dist/providers/apple.js
CHANGED
|
@@ -77,7 +77,8 @@ export class Atlassian {
|
|
|
77
77
|
id: profileId(profile.account_id),
|
|
78
78
|
name: profileString(profile.name) ?? profileString(profile.nickname),
|
|
79
79
|
email: profileString(profile.email),
|
|
80
|
-
image: profileString(profile.picture)
|
|
80
|
+
image: profileString(profile.picture),
|
|
81
|
+
raw: profile
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
84
|
}
|
|
@@ -12,7 +12,7 @@ export declare class Auth0 {
|
|
|
12
12
|
private auth;
|
|
13
13
|
constructor(options: Auth0Options);
|
|
14
14
|
constructor(domain: string, clientId: string, clientSecret: string | null, redirectURI: string);
|
|
15
|
-
createAuthorizationURL(state: string, codeVerifier: string | null, scopes: string[]): URL
|
|
15
|
+
createAuthorizationURL(state: string, codeVerifier: string | null, scopes: string[]): Promise<URL>;
|
|
16
16
|
validateAuthorizationCode(code: string, codeVerifier: string | null): Promise<OAuth2Tokens>;
|
|
17
17
|
refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
|
|
18
18
|
revokeToken(token: string): Promise<void>;
|
package/dist/providers/auth0.js
CHANGED
|
@@ -26,10 +26,10 @@ export class Auth0 {
|
|
|
26
26
|
this.tokenRevocationEndpoint = `https://${domain}/oauth/revoke`;
|
|
27
27
|
this.userinfoEndpoint = `https://${domain}/userinfo`;
|
|
28
28
|
}
|
|
29
|
-
createAuthorizationURL(state, codeVerifier, scopes) {
|
|
29
|
+
async createAuthorizationURL(state, codeVerifier, scopes) {
|
|
30
30
|
let url;
|
|
31
31
|
if (codeVerifier !== null) {
|
|
32
|
-
url = this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
32
|
+
url = await this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
35
|
url = this.client.createAuthorizationURL(this.authorizationEndpoint, state, scopes);
|
|
@@ -51,7 +51,7 @@ export class Auth0 {
|
|
|
51
51
|
const auth = requireAuthConfig(this.auth);
|
|
52
52
|
const state = generateOAuthState();
|
|
53
53
|
const codeVerifier = generateOAuthCodeVerifier();
|
|
54
|
-
const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
54
|
+
const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
55
55
|
await saveOAuthState(auth.store, state, { codeVerifier });
|
|
56
56
|
return url;
|
|
57
57
|
}
|
|
@@ -74,7 +74,8 @@ export class Auth0 {
|
|
|
74
74
|
id: profileId(claims.sub),
|
|
75
75
|
name: profileString(claims.name) ?? profileString(claims.nickname),
|
|
76
76
|
email: profileString(claims.email),
|
|
77
|
-
image: profileString(claims.picture)
|
|
77
|
+
image: profileString(claims.picture),
|
|
78
|
+
raw: claims
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
81
|
}
|
|
@@ -12,7 +12,7 @@ export declare class Authentik {
|
|
|
12
12
|
private auth;
|
|
13
13
|
constructor(options: AuthentikOptions);
|
|
14
14
|
constructor(baseURL: string, clientId: string, clientSecret: string | null, redirectURI: string);
|
|
15
|
-
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL
|
|
15
|
+
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): Promise<URL>;
|
|
16
16
|
validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
|
|
17
17
|
refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
|
|
18
18
|
revokeToken(token: string): Promise<void>;
|
|
@@ -27,8 +27,8 @@ export class Authentik {
|
|
|
27
27
|
this.tokenRevocationEndpoint = joinURIAndPath(baseURL, "/application/o/revoke/");
|
|
28
28
|
this.userinfoEndpoint = joinURIAndPath(baseURL, "/application/o/userinfo/");
|
|
29
29
|
}
|
|
30
|
-
createAuthorizationURL(state, codeVerifier, scopes) {
|
|
31
|
-
const url = this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
30
|
+
async createAuthorizationURL(state, codeVerifier, scopes) {
|
|
31
|
+
const url = await this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
32
32
|
return url;
|
|
33
33
|
}
|
|
34
34
|
async validateAuthorizationCode(code, codeVerifier) {
|
|
@@ -46,7 +46,7 @@ export class Authentik {
|
|
|
46
46
|
const auth = requireAuthConfig(this.auth);
|
|
47
47
|
const state = generateOAuthState();
|
|
48
48
|
const codeVerifier = generateOAuthCodeVerifier();
|
|
49
|
-
const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
49
|
+
const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
50
50
|
await saveOAuthState(auth.store, state, { codeVerifier });
|
|
51
51
|
return url;
|
|
52
52
|
}
|
|
@@ -69,7 +69,8 @@ export class Authentik {
|
|
|
69
69
|
id: profileId(claims.sub),
|
|
70
70
|
name: profileString(claims.name) ?? profileString(claims.preferred_username),
|
|
71
71
|
email: profileString(claims.email),
|
|
72
|
-
image: profileString(claims.picture)
|
|
72
|
+
image: profileString(claims.picture),
|
|
73
|
+
raw: claims
|
|
73
74
|
};
|
|
74
75
|
}
|
|
75
76
|
}
|
|
@@ -7,7 +7,7 @@ export declare class Autodesk {
|
|
|
7
7
|
private auth;
|
|
8
8
|
constructor(options: AutodeskOptions);
|
|
9
9
|
constructor(clientId: string, clientSecret: string | null, redirectURI: string);
|
|
10
|
-
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL
|
|
10
|
+
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): Promise<URL>;
|
|
11
11
|
validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
|
|
12
12
|
refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
|
|
13
13
|
revokeToken(token: string): Promise<void>;
|
|
@@ -18,8 +18,8 @@ export class Autodesk {
|
|
|
18
18
|
this.client = new OAuth2Client(clientIdOrOptions, clientSecret ?? null, redirectURI ?? null);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
createAuthorizationURL(state, codeVerifier, scopes) {
|
|
22
|
-
const url = this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
21
|
+
async createAuthorizationURL(state, codeVerifier, scopes) {
|
|
22
|
+
const url = await this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
23
23
|
return url;
|
|
24
24
|
}
|
|
25
25
|
async validateAuthorizationCode(code, codeVerifier) {
|
|
@@ -37,7 +37,7 @@ export class Autodesk {
|
|
|
37
37
|
const auth = requireAuthConfig(this.auth);
|
|
38
38
|
const state = generateOAuthState();
|
|
39
39
|
const codeVerifier = generateOAuthCodeVerifier();
|
|
40
|
-
const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
40
|
+
const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
41
41
|
await saveOAuthState(auth.store, state, { codeVerifier });
|
|
42
42
|
return url;
|
|
43
43
|
}
|
|
@@ -54,7 +54,8 @@ export class Autodesk {
|
|
|
54
54
|
id: profileId(claims.sub),
|
|
55
55
|
name: profileString(claims.name) ?? profileString(claims.preferred_username),
|
|
56
56
|
email: profileString(claims.email),
|
|
57
|
-
image: profileString(claims.picture)
|
|
57
|
+
image: profileString(claims.picture),
|
|
58
|
+
raw: claims
|
|
58
59
|
};
|
|
59
60
|
}
|
|
60
61
|
}
|
|
@@ -57,7 +57,8 @@ export class Bitbucket {
|
|
|
57
57
|
id: profileId(profile.uuid ?? profile.account_id),
|
|
58
58
|
name: profileString(profile.display_name) ?? profileString(profile.username),
|
|
59
59
|
email: await fetchPrimaryEmail(accessToken),
|
|
60
|
-
image
|
|
60
|
+
image,
|
|
61
|
+
raw: profile
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
64
|
}
|
package/dist/providers/box.js
CHANGED
package/dist/providers/bungie.js
CHANGED
|
@@ -89,7 +89,8 @@ export class Coinbase {
|
|
|
89
89
|
id: profileId(user.id),
|
|
90
90
|
name: profileString(user.name) ?? profileString(user.username),
|
|
91
91
|
email: profileString(user.email),
|
|
92
|
-
image: profileString(user.avatar_url)
|
|
92
|
+
image: profileString(user.avatar_url),
|
|
93
|
+
raw: user
|
|
93
94
|
};
|
|
94
95
|
}
|
|
95
96
|
}
|
|
@@ -7,7 +7,7 @@ export declare class Discord {
|
|
|
7
7
|
private auth;
|
|
8
8
|
constructor(options: DiscordOptions);
|
|
9
9
|
constructor(clientId: string, clientSecret: string | null, redirectURI: string);
|
|
10
|
-
createAuthorizationURL(state: string, codeVerifier: string | null, scopes: string[]): URL
|
|
10
|
+
createAuthorizationURL(state: string, codeVerifier: string | null, scopes: string[]): Promise<URL>;
|
|
11
11
|
validateAuthorizationCode(code: string, codeVerifier: string | null): Promise<OAuth2Tokens>;
|
|
12
12
|
refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
|
|
13
13
|
revokeToken(token: string): Promise<void>;
|
|
@@ -18,10 +18,10 @@ export class Discord {
|
|
|
18
18
|
this.client = new OAuth2Client(clientIdOrOptions, clientSecret ?? null, redirectURI ?? null);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
createAuthorizationURL(state, codeVerifier, scopes) {
|
|
21
|
+
async createAuthorizationURL(state, codeVerifier, scopes) {
|
|
22
22
|
let url;
|
|
23
23
|
if (codeVerifier !== null) {
|
|
24
|
-
url = this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
24
|
+
url = await this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
25
25
|
}
|
|
26
26
|
else {
|
|
27
27
|
url = this.client.createAuthorizationURL(authorizationEndpoint, state, scopes);
|
|
@@ -43,7 +43,7 @@ export class Discord {
|
|
|
43
43
|
const auth = requireAuthConfig(this.auth);
|
|
44
44
|
const state = generateOAuthState();
|
|
45
45
|
const codeVerifier = generateOAuthCodeVerifier();
|
|
46
|
-
const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
46
|
+
const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
47
47
|
await saveOAuthState(auth.store, state, { codeVerifier });
|
|
48
48
|
return url;
|
|
49
49
|
}
|
|
@@ -62,7 +62,8 @@ export class Discord {
|
|
|
62
62
|
id,
|
|
63
63
|
name: profileString(profile.global_name) ?? profileString(profile.username),
|
|
64
64
|
email: profileString(profile.email),
|
|
65
|
-
image: avatar === null ? null : `https://cdn.discordapp.com/avatars/${id}/${avatar}.png
|
|
65
|
+
image: avatar === null ? null : `https://cdn.discordapp.com/avatars/${id}/${avatar}.png`,
|
|
66
|
+
raw: profile
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
69
|
}
|
|
@@ -80,7 +80,8 @@ export class DonationAlerts {
|
|
|
80
80
|
id: profileId(user.id),
|
|
81
81
|
name: profileString(user.name) ?? profileString(user.code),
|
|
82
82
|
email: profileString(user.email),
|
|
83
|
-
image: profileString(user.avatar)
|
|
83
|
+
image: profileString(user.avatar),
|
|
84
|
+
raw: user
|
|
84
85
|
};
|
|
85
86
|
}
|
|
86
87
|
}
|
|
@@ -67,7 +67,8 @@ export class Dribbble {
|
|
|
67
67
|
name: profileString(profile.name) ?? profileString(profile.login),
|
|
68
68
|
// The v2 user endpoint does not expose an email address.
|
|
69
69
|
email: null,
|
|
70
|
-
image: profileString(profile.avatar_url)
|
|
70
|
+
image: profileString(profile.avatar_url),
|
|
71
|
+
raw: profile
|
|
71
72
|
};
|
|
72
73
|
}
|
|
73
74
|
}
|
package/dist/providers/etsy.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare class Etsy {
|
|
|
7
7
|
private auth;
|
|
8
8
|
constructor(options: EtsyOptions);
|
|
9
9
|
constructor(clientId: string, redirectURI: string);
|
|
10
|
-
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL
|
|
10
|
+
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): Promise<URL>;
|
|
11
11
|
validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
|
|
12
12
|
refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
|
|
13
13
|
getAuthorizationURL(scopes?: string[]): Promise<URL>;
|
package/dist/providers/etsy.js
CHANGED
|
@@ -18,8 +18,8 @@ export class Etsy {
|
|
|
18
18
|
this.client = new OAuth2Client(clientIdOrOptions, null, redirectURI ?? null);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
createAuthorizationURL(state, codeVerifier, scopes) {
|
|
22
|
-
const url = this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
21
|
+
async createAuthorizationURL(state, codeVerifier, scopes) {
|
|
22
|
+
const url = await this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
23
23
|
return url;
|
|
24
24
|
}
|
|
25
25
|
async validateAuthorizationCode(code, codeVerifier) {
|
|
@@ -34,7 +34,7 @@ export class Etsy {
|
|
|
34
34
|
const auth = requireAuthConfig(this.auth);
|
|
35
35
|
const state = generateOAuthState();
|
|
36
36
|
const codeVerifier = generateOAuthCodeVerifier();
|
|
37
|
-
const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
37
|
+
const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
38
38
|
await saveOAuthState(auth.store, state, { codeVerifier });
|
|
39
39
|
return url;
|
|
40
40
|
}
|
|
@@ -62,7 +62,8 @@ export class Etsy {
|
|
|
62
62
|
id: userId,
|
|
63
63
|
name,
|
|
64
64
|
email: profileString(profile.primary_email),
|
|
65
|
-
image: profileString(profile.image_url_75x75)
|
|
65
|
+
image: profileString(profile.image_url_75x75),
|
|
66
|
+
raw: profile
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
69
|
}
|
package/dist/providers/figma.js
CHANGED
|
@@ -11,7 +11,7 @@ export declare class Gitea {
|
|
|
11
11
|
private auth;
|
|
12
12
|
constructor(options: GiteaOptions);
|
|
13
13
|
constructor(baseURL: string, clientId: string, clientSecret: string | null, redirectURI: string);
|
|
14
|
-
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL
|
|
14
|
+
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): Promise<URL>;
|
|
15
15
|
validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
|
|
16
16
|
refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
|
|
17
17
|
getAuthorizationURL(scopes?: string[]): Promise<URL>;
|
package/dist/providers/gitea.js
CHANGED
|
@@ -22,8 +22,8 @@ export class Gitea {
|
|
|
22
22
|
this.authorizationEndpoint = joinURIAndPath(this.baseURL, "/login/oauth/authorize");
|
|
23
23
|
this.tokenEndpoint = joinURIAndPath(this.baseURL, "/login/oauth/access_token");
|
|
24
24
|
}
|
|
25
|
-
createAuthorizationURL(state, codeVerifier, scopes) {
|
|
26
|
-
const url = this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
25
|
+
async createAuthorizationURL(state, codeVerifier, scopes) {
|
|
26
|
+
const url = await this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
27
27
|
return url;
|
|
28
28
|
}
|
|
29
29
|
async validateAuthorizationCode(code, codeVerifier) {
|
|
@@ -38,7 +38,7 @@ export class Gitea {
|
|
|
38
38
|
const auth = requireAuthConfig(this.auth);
|
|
39
39
|
const state = generateOAuthState();
|
|
40
40
|
const codeVerifier = generateOAuthCodeVerifier();
|
|
41
|
-
const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
41
|
+
const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
42
42
|
await saveOAuthState(auth.store, state, { codeVerifier });
|
|
43
43
|
return url;
|
|
44
44
|
}
|
|
@@ -56,7 +56,8 @@ export class Gitea {
|
|
|
56
56
|
id: profileId(profile.id),
|
|
57
57
|
name: profileString(profile.full_name) ?? profileString(profile.login),
|
|
58
58
|
email: profileString(profile.email),
|
|
59
|
-
image: profileString(profile.avatar_url)
|
|
59
|
+
image: profileString(profile.avatar_url),
|
|
60
|
+
raw: profile
|
|
60
61
|
};
|
|
61
62
|
}
|
|
62
63
|
}
|
package/dist/providers/github.js
CHANGED
package/dist/providers/gitlab.js
CHANGED
|
@@ -58,7 +58,8 @@ export class GitLab {
|
|
|
58
58
|
id: profileId(claims.sub),
|
|
59
59
|
name: profileString(claims.name) ?? profileString(claims.nickname),
|
|
60
60
|
email: profileString(claims.email),
|
|
61
|
-
image: profileString(claims.picture)
|
|
61
|
+
image: profileString(claims.picture),
|
|
62
|
+
raw: claims
|
|
62
63
|
};
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -7,7 +7,7 @@ export declare class Google {
|
|
|
7
7
|
private auth;
|
|
8
8
|
constructor(options: GoogleOptions);
|
|
9
9
|
constructor(clientId: string, clientSecret: string, redirectURI: string);
|
|
10
|
-
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL
|
|
10
|
+
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): Promise<URL>;
|
|
11
11
|
validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
|
|
12
12
|
refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
|
|
13
13
|
revokeToken(token: string): Promise<void>;
|
package/dist/providers/google.js
CHANGED
|
@@ -22,8 +22,8 @@ export class Google {
|
|
|
22
22
|
this.client = new OAuth2Client(clientIdOrOptions, clientSecret ?? null, redirectURI ?? null);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
createAuthorizationURL(state, codeVerifier, scopes) {
|
|
26
|
-
const url = this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
25
|
+
async createAuthorizationURL(state, codeVerifier, scopes) {
|
|
26
|
+
const url = await this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
27
27
|
return url;
|
|
28
28
|
}
|
|
29
29
|
async validateAuthorizationCode(code, codeVerifier) {
|
|
@@ -41,7 +41,7 @@ export class Google {
|
|
|
41
41
|
const auth = requireAuthConfig(this.auth);
|
|
42
42
|
const state = generateOAuthState();
|
|
43
43
|
const codeVerifier = generateOAuthCodeVerifier();
|
|
44
|
-
const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
44
|
+
const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
45
45
|
await saveOAuthState(auth.store, state, { codeVerifier });
|
|
46
46
|
return url;
|
|
47
47
|
}
|
|
@@ -64,7 +64,8 @@ export class Google {
|
|
|
64
64
|
id: profileId(claims.sub),
|
|
65
65
|
name: profileString(claims.name),
|
|
66
66
|
email: profileString(claims.email),
|
|
67
|
-
image: profileString(claims.picture)
|
|
67
|
+
image: profileString(claims.picture),
|
|
68
|
+
raw: claims
|
|
68
69
|
};
|
|
69
70
|
}
|
|
70
71
|
}
|
package/dist/providers/intuit.js
CHANGED
package/dist/providers/kakao.js
CHANGED
|
@@ -12,7 +12,7 @@ export declare class KeyCloak {
|
|
|
12
12
|
private auth;
|
|
13
13
|
constructor(options: KeyCloakOptions);
|
|
14
14
|
constructor(realmURL: string, clientId: string, clientSecret: string | null, redirectURI: string);
|
|
15
|
-
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL
|
|
15
|
+
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): Promise<URL>;
|
|
16
16
|
validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
|
|
17
17
|
refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
|
|
18
18
|
revokeToken(token: string): Promise<void>;
|