fix(auth): add remove() trap to engine auth storage proxy

The CLI proxy already had a remove() trap, but the engine's
createFusionAuthStorage was missing it. Without this trap, calling
remove() on a provider would delete the credential from storage but
not add it to loggedOutProviders, allowing fallback credentials to
resurrect the provider on the next read.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Timothy Laurent
2026-05-05 22:00:07 -07:00
parent 0a588b701f
commit 0d29dc3eb9

View File

@@ -183,6 +183,13 @@ export function createFusionAuthStorage(): AuthStorage {
};
}
if (prop === "remove") {
return (provider: string) => {
target.remove(provider);
loggedOutProviders.add(provider);
};
}
if (prop === "set") {
return (provider: string, credential: AuthCredential) => {
target.set(provider, credential);