sodabase 0.1.2 → 0.1.3
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/api/gotrueAuth.js +7 -3
- package/package.json +1 -1
package/dist/api/gotrueAuth.js
CHANGED
|
@@ -99,9 +99,13 @@ export async function loopbackSignIn(cfg = resolveGoTrueConfig(), opts = {}) {
|
|
|
99
99
|
res.end();
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
|
|
102
|
+
// Supabase's PKCE redirect does NOT echo our `state` back, so we can't require it — PKCE
|
|
103
|
+
// (code_challenge/verifier) is the real anti-injection guarantee: an injected code can't be
|
|
104
|
+
// exchanged without our verifier, which never leaves this process. We still reject a callback
|
|
105
|
+
// that echoes a DIFFERENT state (a stray hit from another in-flight flow); a missing state is
|
|
106
|
+
// the normal Supabase case and must be accepted, or sign-in would 404 the real redirect and hang.
|
|
107
|
+
const returnedState = u.searchParams.get("state");
|
|
108
|
+
if (returnedState !== null && returnedState !== state) {
|
|
105
109
|
res.writeHead(404);
|
|
106
110
|
res.end();
|
|
107
111
|
return;
|