Browse Source

Use URL-safe base64 for NIP-98 auth encoding (v0.39.2)

- Fix base64 encoding to use URL-safe format (- instead of +, _ instead of /)
- Remove padding characters (=) from base64 output
- Apply fix to LogView, BlossomView, and api.js

Files modified:
- app/web/src/LogView.svelte: URL-safe base64 for NIP-98 auth
- app/web/src/BlossomView.svelte: URL-safe base64 for Blossom auth
- app/web/src/api.js: URL-safe base64 for NIP-98 auth
- pkg/version/version: Bump to v0.39.2

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
main
mleku 2 weeks ago
parent
commit
ce54a6886a
No known key found for this signature in database
  1. 2
      app/web/dist/bundle.js
  2. 2
      app/web/dist/bundle.js.map
  3. 3
      app/web/src/BlossomView.svelte
  4. 3
      app/web/src/LogView.svelte
  5. 3
      app/web/src/api.js
  6. 2
      pkg/version/version

2
app/web/dist/bundle.js vendored

File diff suppressed because one or more lines are too long

2
app/web/dist/bundle.js.map vendored

File diff suppressed because one or more lines are too long

3
app/web/src/BlossomView.svelte

@ -76,7 +76,8 @@ @@ -76,7 +76,8 @@
};
const signedEvent = await signer.signEvent(authEvent);
return btoa(JSON.stringify(signedEvent));
// Use URL-safe base64 encoding
return btoa(JSON.stringify(signedEvent)).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
} catch (err) {
console.error("Error creating Blossom auth:", err);
return null;

3
app/web/src/LogView.svelte

@ -75,7 +75,8 @@ @@ -75,7 +75,8 @@
};
const signedEvent = await userSigner.signEvent(authEvent);
return btoa(JSON.stringify(signedEvent));
// Use URL-safe base64 encoding (replace + with -, / with _, remove padding)
return btoa(JSON.stringify(signedEvent)).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
} catch (err) {
console.error("Error creating auth header:", err);
return null;

3
app/web/src/api.js

@ -30,7 +30,8 @@ export async function createNIP98Auth(signer, pubkey, method, url) { @@ -30,7 +30,8 @@ export async function createNIP98Auth(signer, pubkey, method, url) {
// Sign using the signer
const signedEvent = await signer.signEvent(authEvent);
return btoa(JSON.stringify(signedEvent));
// Use URL-safe base64 encoding
return btoa(JSON.stringify(signedEvent)).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
} catch (error) {
console.error("Error creating NIP-98 auth:", error);
return null;

2
pkg/version/version

@ -1 +1 @@ @@ -1 +1 @@
v0.39.1
v0.39.2

Loading…
Cancel
Save