@jskit-ai/auth-provider-supabase-core 0.2.24 → 0.2.26
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- The second-factor operations (`getSecondFactorStatus`, `startSecondFactorSetup`, `confirmSecondFactorSetup`, `verifySecondFactor`, `replaceSecondFactorRecoveryCodes`, `removeSecondFactor`, `listSecondFactors`, `resetSecondFactor`) answer `AUTH_OPERATION_UNSUPPORTED`, and `features.secondFactor` is false.
|
|
5
6
|
- Reading the signed-in user for the security screen and account changes asks Supabase for a valid access token's user once instead of twice; it asks again only for the new token a session refresh issued.
|
|
6
7
|
- A request with a valid access token synchronizes the app profile only when it is missing or no longer matches the token's email and display name (`onlyWhenChanged`), after one read instead of two plus a transaction; sign-in, account changes and a session refresh synchronize in full. Visible difference: a personal workspace, owner membership or settings row deleted while someone is signed in comes back at their next session refresh or sign-in instead of their next request.
|
|
7
8
|
- `confirmRegistration` answers `AUTH_OPERATION_UNSUPPORTED`: Supabase confirms an email through its own link.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/auth-provider-supabase-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jskit test"
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@jskit-ai/auth-core": "0.2.
|
|
64
|
-
"@jskit-ai/kernel": "0.2.
|
|
63
|
+
"@jskit-ai/auth-core": "0.2.23",
|
|
64
|
+
"@jskit-ai/kernel": "0.2.22"
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -88,6 +88,9 @@ function createSupabaseAuthService({ config, profiles }) {
|
|
|
88
88
|
throwUnsupportedAuthOperation("confirmRegistration");
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
// Supabase keeps its own second factors, which JSKIT's second factor operations do not reach.
|
|
92
|
+
const unsupported = (operation) => () => throwUnsupportedAuthOperation(operation);
|
|
93
|
+
|
|
91
94
|
function isDevAuthBootstrapEnabled() {
|
|
92
95
|
return config.devAuth.enabled === true;
|
|
93
96
|
}
|
|
@@ -136,7 +139,15 @@ function createSupabaseAuthService({ config, profiles }) {
|
|
|
136
139
|
hasAccessTokenCookie: sessions.hasAccessTokenCookie,
|
|
137
140
|
hasSessionCookie: sessions.hasSessionCookie,
|
|
138
141
|
writeSessionCookies: sessions.writeSessionCookies,
|
|
139
|
-
clearSessionCookies: sessions.clearSessionCookies
|
|
142
|
+
clearSessionCookies: sessions.clearSessionCookies,
|
|
143
|
+
getSecondFactorStatus: unsupported("getSecondFactorStatus"),
|
|
144
|
+
startSecondFactorSetup: unsupported("startSecondFactorSetup"),
|
|
145
|
+
confirmSecondFactorSetup: unsupported("confirmSecondFactorSetup"),
|
|
146
|
+
verifySecondFactor: unsupported("verifySecondFactor"),
|
|
147
|
+
replaceSecondFactorRecoveryCodes: unsupported("replaceSecondFactorRecoveryCodes"),
|
|
148
|
+
removeSecondFactor: unsupported("removeSecondFactor"),
|
|
149
|
+
listSecondFactors: unsupported("listSecondFactors"),
|
|
150
|
+
resetSecondFactor: unsupported("resetSecondFactor")
|
|
140
151
|
});
|
|
141
152
|
}
|
|
142
153
|
|
|
@@ -62,6 +62,11 @@ test("AuthSupabaseProvider exposes a configured provider-owned auth service", as
|
|
|
62
62
|
assert.equal(authService.getCapabilities().provider.id, "supabase");
|
|
63
63
|
assert.equal(authService.getCapabilities().features.appProfileProjection, false);
|
|
64
64
|
assert.equal(authService.getCapabilities().features.password.methodToggle, false);
|
|
65
|
+
assert.equal(authService.getCapabilities().features.secondFactor, false);
|
|
66
|
+
assert.throws(() => authService.resetSecondFactor({ userId: "usr_1", byUserId: "usr_2" }), {
|
|
67
|
+
status: 501,
|
|
68
|
+
code: "AUTH_OPERATION_UNSUPPORTED"
|
|
69
|
+
});
|
|
65
70
|
await runtime.shutdown();
|
|
66
71
|
});
|
|
67
72
|
|