Skip to content

Commit a0aa6a4

Browse files
committed
fix: add missing isPlatformError type guard in ServerSecretStore.get
The get method was accessing cause.reason._tag without first checking if cause is a PlatformError, which could throw a TypeError at runtime. This adds the isPlatformError guard consistent with remove and getOrCreateRandom.
1 parent 73ba21e commit a0aa6a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/server/src/auth/Layers/ServerSecretStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const makeServerSecretStore = Effect.gen(function* () {
3535
fileSystem.readFile(resolveSecretPath(name)).pipe(
3636
Effect.map((bytes) => Uint8Array.from(bytes)),
3737
Effect.catch((cause) =>
38-
cause.reason._tag === "NotFound"
38+
isPlatformError(cause) && cause.reason._tag === "NotFound"
3939
? Effect.succeed(null)
4040
: Effect.fail(
4141
new SecretStoreError({

0 commit comments

Comments
 (0)