Fix NSFW settings by signing client mutations and handling locked identities

Hop-State: A_06FP8RGGWKVFCFAHNJBQWT0
Hop-Proposal: R_06FP8RG166W8E071QG1PYWG
Hop-Task: T_06FP8QVS84N3BR04V6F3GJG
Hop-Attempt: AT_06FP8QVS87X77VCAYKNHKF0
This commit is contained in:
2026-07-14 23:06:16 -07:00
committed by Hop
parent 1427df4bdc
commit 1db2933758
5 changed files with 159 additions and 15 deletions
+8 -1
View File
@@ -29,6 +29,13 @@ export interface SignedAction {
sig: string;
}
export class SignedActionError extends Error {
constructor(message: string) {
super(message);
this.name = 'SignedActionError';
}
}
/**
* Verify a signed action against a specific public key
*/
@@ -146,7 +153,7 @@ export async function requireSignedAction(signedAction: SignedAction): Promise<t
const result = await verifyUserAction(signedAction);
if (!result.valid) {
throw new Error(result.error || 'Invalid signature');
throw new SignedActionError(result.error || 'Invalid signature');
}
return result.user!;