@xtr-dev/rondevu-client 0.12.1 → 0.12.3
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/dist/api.d.ts +3 -1
- package/dist/rondevu-service.js +10 -3
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -152,7 +152,9 @@ export declare class RondevuAPI {
|
|
|
152
152
|
*/
|
|
153
153
|
checkUsername(username: string): Promise<{
|
|
154
154
|
available: boolean;
|
|
155
|
-
|
|
155
|
+
publicKey?: string;
|
|
156
|
+
claimedAt?: number;
|
|
157
|
+
expiresAt?: number;
|
|
156
158
|
}>;
|
|
157
159
|
/**
|
|
158
160
|
* Claim a username (requires Ed25519 signature)
|
package/dist/rondevu-service.js
CHANGED
|
@@ -63,8 +63,7 @@ export class RondevuService {
|
|
|
63
63
|
const check = await this.api.checkUsername(this.username);
|
|
64
64
|
if (!check.available) {
|
|
65
65
|
// Verify it's claimed by us
|
|
66
|
-
|
|
67
|
-
if (owner === this.keypair.publicKey) {
|
|
66
|
+
if (check.publicKey === this.keypair.publicKey) {
|
|
68
67
|
this.usernameClaimed = true;
|
|
69
68
|
return;
|
|
70
69
|
}
|
|
@@ -132,8 +131,16 @@ export class RondevuService {
|
|
|
132
131
|
}
|
|
133
132
|
try {
|
|
134
133
|
const check = await this.api.checkUsername(this.username);
|
|
134
|
+
// Debug logging
|
|
135
|
+
console.log('[RondevuService] Username check:', {
|
|
136
|
+
username: this.username,
|
|
137
|
+
available: check.available,
|
|
138
|
+
serverPublicKey: check.publicKey,
|
|
139
|
+
localPublicKey: this.keypair.publicKey,
|
|
140
|
+
match: check.publicKey === this.keypair.publicKey
|
|
141
|
+
});
|
|
135
142
|
// Username is claimed if it's not available and owned by our public key
|
|
136
|
-
const claimed = !check.available &&
|
|
143
|
+
const claimed = !check.available && check.publicKey === this.keypair.publicKey;
|
|
137
144
|
// Update internal flag to match server state
|
|
138
145
|
this.usernameClaimed = claimed;
|
|
139
146
|
return claimed;
|
package/package.json
CHANGED