mirror of
https://github.com/xtr-dev/rondevu-server.git
synced 2025-12-13 20:33:25 +00:00
Fix: Correct validateUsernameClaim function calls
The function expects 4 separate parameters, not an object. This was causing 'Username must be a string' errors because the entire object was being passed as the username parameter.
This commit is contained in:
14
src/rpc.ts
14
src/rpc.ts
@@ -67,12 +67,12 @@ async function verifyAuth(
|
||||
}
|
||||
|
||||
// Validate username format before claiming
|
||||
const validation = await validateUsernameClaim({
|
||||
const validation = await validateUsernameClaim(
|
||||
username,
|
||||
publicKey,
|
||||
signature,
|
||||
message,
|
||||
});
|
||||
message
|
||||
);
|
||||
|
||||
if (!validation.valid) {
|
||||
return {
|
||||
@@ -159,12 +159,12 @@ const handlers: Record<string, RpcHandler> = {
|
||||
const { username, publicKey: paramPublicKey } = params;
|
||||
|
||||
// Validate claim
|
||||
const validation = await validateUsernameClaim({
|
||||
const validation = await validateUsernameClaim(
|
||||
username,
|
||||
publicKey: paramPublicKey,
|
||||
paramPublicKey,
|
||||
signature,
|
||||
message,
|
||||
});
|
||||
message
|
||||
);
|
||||
|
||||
if (!validation.valid) {
|
||||
throw new Error(validation.error || 'Invalid username claim');
|
||||
|
||||
Reference in New Issue
Block a user