@better-auth/core 1.4.8-beta.7 → 1.4.9
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/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @better-auth/core@1.4.
|
|
2
|
+
> @better-auth/core@1.4.9 build /home/runner/work/better-auth/better-auth/packages/core
|
|
3
3
|
> tsdown
|
|
4
4
|
|
|
5
5
|
[34mℹ[39m tsdown [2mv0.17.2[22m powered by rolldown [2mv1.0.0-beta.53[22m
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[34mℹ[39m entry: [34msrc/index.ts, src/db/index.ts, src/db/adapter/index.ts, src/async_hooks/index.ts, src/async_hooks/pure.index.ts, src/context/index.ts, src/env/index.ts, src/oauth2/index.ts, src/api/index.ts, src/social-providers/index.ts, src/utils/index.ts, src/error/index.ts[39m
|
|
8
8
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
9
9
|
[34mℹ[39m Build start
|
|
10
|
-
[34mℹ[39m [2mdist/[22m[1msocial-providers/index.mjs[22m [2m 80.
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1msocial-providers/index.mjs[22m [2m 80.96 kB[22m [2m│ gzip: 10.43 kB[22m
|
|
11
11
|
[34mℹ[39m [2mdist/[22m[1mdb/adapter/index.mjs[22m [2m 38.55 kB[22m [2m│ gzip: 7.86 kB[22m
|
|
12
12
|
[34mℹ[39m [2mdist/[22m[1mdb/index.mjs[22m [2m 1.66 kB[22m [2m│ gzip: 0.54 kB[22m
|
|
13
13
|
[34mℹ[39m [2mdist/[22m[1mapi/index.mjs[22m [2m 1.23 kB[22m [2m│ gzip: 0.48 kB[22m
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
[34mℹ[39m [2mdist/[22m[32m[1masync_hooks/pure.index.d.mts[22m[39m [2m 0.22 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
40
40
|
[34mℹ[39m [2mdist/[22m[32mindex-Zbo6xPkd.d.mts[39m [2m221.47 kB[22m [2m│ gzip: 35.34 kB[22m
|
|
41
41
|
[34mℹ[39m [2mdist/[22m[32mindex-BRBu0-5h.d.mts[39m [2m 3.31 kB[22m [2m│ gzip: 1.11 kB[22m
|
|
42
|
-
[34mℹ[39m 32 files, total: 400.
|
|
43
|
-
[32m✔[39m Build complete in [
|
|
42
|
+
[34mℹ[39m 32 files, total: 400.76 kB
|
|
43
|
+
[32m✔[39m Build complete in [32m4832ms[39m
|
|
@@ -203,7 +203,7 @@ const cognito = (options) => {
|
|
|
203
203
|
];
|
|
204
204
|
if (options.scope) _scopes.push(...options.scope);
|
|
205
205
|
if (scopes) _scopes.push(...scopes);
|
|
206
|
-
|
|
206
|
+
const url = await createAuthorizationURL({
|
|
207
207
|
id: "cognito",
|
|
208
208
|
options: { ...options },
|
|
209
209
|
authorizationEndpoint,
|
|
@@ -213,6 +213,15 @@ const cognito = (options) => {
|
|
|
213
213
|
redirectURI,
|
|
214
214
|
prompt: options.prompt
|
|
215
215
|
});
|
|
216
|
+
const scopeValue = url.searchParams.get("scope");
|
|
217
|
+
if (scopeValue) {
|
|
218
|
+
url.searchParams.delete("scope");
|
|
219
|
+
const encodedScope = encodeURIComponent(scopeValue);
|
|
220
|
+
const urlString = url.toString();
|
|
221
|
+
const separator = urlString.includes("?") ? "&" : "?";
|
|
222
|
+
return new URL(`${urlString}${separator}scope=${encodedScope}`);
|
|
223
|
+
}
|
|
224
|
+
return url;
|
|
216
225
|
},
|
|
217
226
|
validateAuthorizationCode: async ({ code, codeVerifier, redirectURI }) => {
|
|
218
227
|
return validateAuthorizationCode({
|
package/package.json
CHANGED
|
@@ -92,6 +92,17 @@ export const cognito = (options: CognitoOptions) => {
|
|
|
92
92
|
redirectURI,
|
|
93
93
|
prompt: options.prompt,
|
|
94
94
|
});
|
|
95
|
+
// AWS Cognito requires scopes to be encoded with %20 instead of +
|
|
96
|
+
// URLSearchParams encodes spaces as + by default, so we need to fix this
|
|
97
|
+
const scopeValue = url.searchParams.get("scope");
|
|
98
|
+
if (scopeValue) {
|
|
99
|
+
url.searchParams.delete("scope");
|
|
100
|
+
const encodedScope = encodeURIComponent(scopeValue);
|
|
101
|
+
// Manually append the scope with proper encoding to the URL
|
|
102
|
+
const urlString = url.toString();
|
|
103
|
+
const separator = urlString.includes("?") ? "&" : "?";
|
|
104
|
+
return new URL(`${urlString}${separator}scope=${encodedScope}`);
|
|
105
|
+
}
|
|
95
106
|
return url;
|
|
96
107
|
},
|
|
97
108
|
|