@cedarjs/auth-supabase-web 1.0.0-canary.12695 → 1.0.0-canary.12696
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/cjs/supabase.d.ts.map +1 -1
- package/dist/cjs/supabase.js +26 -11
- package/dist/supabase.d.ts.map +1 -1
- package/dist/supabase.js +26 -11
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/supabase.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,WAAW,EACX,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,iCAAiC,EACjC,aAAa,EAId,MAAM,uBAAuB,CAAA;AAG9B,OAAO,KAAK,EAAE,WAAW,EAAuB,MAAM,eAAe,CAAA;AAMrE,MAAM,MAAM,sBAAsB,GAAG,0BAA0B,GAAG;IAChE,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,4BAA4B,GAAG;IACpE,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,6BAA6B,GAAG;IACtE,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,6BAA6B,GACvC,iCAAiC,GAAG;IAClC,UAAU,EAAE,KAAK,CAAA;CAClB,CAAA;AAEH,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG;IACjD,UAAU,EAAE,KAAK,CAAA;CAClB,CAAA;AAmBD,wBAAgB,UAAU,CACxB,cAAc,EAAE,cAAc,EAC9B,mBAAmB,CAAC,EAAE;IACpB,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAA;IAC3C,UAAU,CAAC,EAAE,CACX,WAAW,EAAE,WAAW,GAAG,IAAI,KAC5B,CAAC,YAAY,EAAE,MAAM,G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AAC;gBAAoS,CAAC;wBAA0H,CAAC;mBAAwF,CAAC;;;oBA7R1gK,KAAK;;;;sBA6RqnS,CAAC;wBAA0H,CAAC;;;oBAzRxvS,KAAK;;;;sBAyRm9S,CAAC;wBAA0H,CAAC;;;oBAzRplT,KAAK;;;;;2BAyR25D,CAAC;gBAAmS,CAAC;wBAA0H,CAAC;;;;;;gBAA6a,CAAC;wBAA0K,CAAC;mBAAwF,CAAC;;;;;;;;wBAAoU,CAAC;;;oBAlSvzG,UAAU;;;;;wBAkSijH,CAAC;;;oBAlS5jH,UAAU;;;;2BAkS0xH,CAAC;4BAA4H,CAAC;gBAAoS,CAAC;wBAA0H,CAAC;;;oBA7Rh0I,KAAK;;;;4BA6R2gJ,CAAC;gBAAoS,CAAC;wBAA0H,CAAC;mBAAwF,CAAC;;;oBA7R1gK,KAAK;;;;sBA6RqnS,CAAC;wBAA0H,CAAC;;;oBAzRxvS,KAAK;;;;sBAyRm9S,CAAC;wBAA0H,CAAC;;;oBAzRplT,KAAK;;;;;2BAyR25D,CAAC;gBAAmS,CAAC;wBAA0H,CAAC;;;;;;gBAA6a,CAAC;wBAA0K,CAAC;mBAAwF,CAAC;;;EArP//F"}
|
package/dist/cjs/supabase.js
CHANGED
|
@@ -196,13 +196,14 @@ function createAuthImplementation({
|
|
|
196
196
|
return data?.session?.user?.user_metadata ?? null;
|
|
197
197
|
},
|
|
198
198
|
/**
|
|
199
|
-
* Restore
|
|
200
|
-
*
|
|
201
|
-
*
|
|
199
|
+
* Restore CedarJS authentication state when an OAuth or magiclink callback
|
|
200
|
+
* redirects back to site with access token by restoring the Supabase auth
|
|
201
|
+
* session.
|
|
202
202
|
*
|
|
203
|
-
* Initializes the Supabase client session either from the url or from
|
|
204
|
-
* This method is automatically called when instantiating the
|
|
205
|
-
* manually when checking for an error
|
|
203
|
+
* Initializes the Supabase client session either from the url or from
|
|
204
|
+
* storage. This method is automatically called when instantiating the
|
|
205
|
+
* client, but should also be called manually when checking for an error
|
|
206
|
+
* from an auth redirect (oauth, magiclink, password recovery, etc).
|
|
206
207
|
*/
|
|
207
208
|
restoreAuthState: async () => {
|
|
208
209
|
try {
|
|
@@ -214,11 +215,25 @@ function createAuthImplementation({
|
|
|
214
215
|
expireAuthProviderCookie();
|
|
215
216
|
}
|
|
216
217
|
}
|
|
217
|
-
window.
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
218
|
+
const currentUrl = new URL(window.location.href);
|
|
219
|
+
const authParams = [
|
|
220
|
+
"access_token",
|
|
221
|
+
"refresh_token",
|
|
222
|
+
"token_type",
|
|
223
|
+
"expires_in",
|
|
224
|
+
"expires_at"
|
|
225
|
+
];
|
|
226
|
+
let hasAuthParams = false;
|
|
227
|
+
authParams.forEach((param) => {
|
|
228
|
+
if (currentUrl.searchParams.has(param)) {
|
|
229
|
+
currentUrl.searchParams.delete(param);
|
|
230
|
+
hasAuthParams = true;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
if (hasAuthParams) {
|
|
234
|
+
const cleanUrl = currentUrl.pathname + (currentUrl.search || "");
|
|
235
|
+
window.history.replaceState({}, document.title, cleanUrl);
|
|
236
|
+
}
|
|
222
237
|
} catch (error) {
|
|
223
238
|
console.error(error);
|
|
224
239
|
}
|
package/dist/supabase.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../src/supabase.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,WAAW,EACX,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,iCAAiC,EACjC,aAAa,EAId,MAAM,uBAAuB,CAAA;AAG9B,OAAO,KAAK,EAAE,WAAW,EAAuB,MAAM,eAAe,CAAA;AAMrE,MAAM,MAAM,sBAAsB,GAAG,0BAA0B,GAAG;IAChE,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,MAAM,M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A0H,CAAC;;;;;;gBAA6a,CAAC;wBAA0K,CAAC;mBAAwF,CAAC;;;EArP//F"}
|
package/dist/supabase.js
CHANGED
|
@@ -176,13 +176,14 @@ function createAuthImplementation({
|
|
|
176
176
|
return data?.session?.user?.user_metadata ?? null;
|
|
177
177
|
},
|
|
178
178
|
/**
|
|
179
|
-
* Restore
|
|
180
|
-
*
|
|
181
|
-
*
|
|
179
|
+
* Restore CedarJS authentication state when an OAuth or magiclink callback
|
|
180
|
+
* redirects back to site with access token by restoring the Supabase auth
|
|
181
|
+
* session.
|
|
182
182
|
*
|
|
183
|
-
* Initializes the Supabase client session either from the url or from
|
|
184
|
-
* This method is automatically called when instantiating the
|
|
185
|
-
* manually when checking for an error
|
|
183
|
+
* Initializes the Supabase client session either from the url or from
|
|
184
|
+
* storage. This method is automatically called when instantiating the
|
|
185
|
+
* client, but should also be called manually when checking for an error
|
|
186
|
+
* from an auth redirect (oauth, magiclink, password recovery, etc).
|
|
186
187
|
*/
|
|
187
188
|
restoreAuthState: async () => {
|
|
188
189
|
try {
|
|
@@ -194,11 +195,25 @@ function createAuthImplementation({
|
|
|
194
195
|
expireAuthProviderCookie();
|
|
195
196
|
}
|
|
196
197
|
}
|
|
197
|
-
window.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
198
|
+
const currentUrl = new URL(window.location.href);
|
|
199
|
+
const authParams = [
|
|
200
|
+
"access_token",
|
|
201
|
+
"refresh_token",
|
|
202
|
+
"token_type",
|
|
203
|
+
"expires_in",
|
|
204
|
+
"expires_at"
|
|
205
|
+
];
|
|
206
|
+
let hasAuthParams = false;
|
|
207
|
+
authParams.forEach((param) => {
|
|
208
|
+
if (currentUrl.searchParams.has(param)) {
|
|
209
|
+
currentUrl.searchParams.delete(param);
|
|
210
|
+
hasAuthParams = true;
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
if (hasAuthParams) {
|
|
214
|
+
const cleanUrl = currentUrl.pathname + (currentUrl.search || "");
|
|
215
|
+
window.history.replaceState({}, document.title, cleanUrl);
|
|
216
|
+
}
|
|
202
217
|
} catch (error) {
|
|
203
218
|
console.error(error);
|
|
204
219
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/auth-supabase-web",
|
|
3
|
-
"version": "1.0.0-canary.
|
|
3
|
+
"version": "1.0.0-canary.12696+23ff3ce3e",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"test:watch": "vitest watch"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@cedarjs/auth": "1.0.0-canary.
|
|
52
|
+
"@cedarjs/auth": "1.0.0-canary.12696"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@cedarjs/framework-tools": "1.0.0-canary.
|
|
55
|
+
"@cedarjs/framework-tools": "1.0.0-canary.12696",
|
|
56
56
|
"@supabase/ssr": "0.5.1",
|
|
57
57
|
"@supabase/supabase-js": "2.45.4",
|
|
58
58
|
"@types/react": "^18.2.55",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "23ff3ce3e8edc97dcb3d47e39df0a1b2779852ac"
|
|
73
73
|
}
|