mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Encode VAPID public key with base64url
This commit is contained in:
parent
5b6cacc2ed
commit
45cf74c168
1 changed files with 3 additions and 2 deletions
|
|
@ -3,7 +3,8 @@ import ISO6391, { LanguageCode } from 'iso-639-1';
|
||||||
import * as dotenv from '@std/dotenv';
|
import * as dotenv from '@std/dotenv';
|
||||||
import { getPublicKey, nip19 } from 'nostr-tools';
|
import { getPublicKey, nip19 } from 'nostr-tools';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { decodeBase64, encodeBase64 } from '@std/encoding/base64';
|
import { decodeBase64 } from '@std/encoding/base64';
|
||||||
|
import { encodeBase64Url } from '@std/encoding/base64url';
|
||||||
|
|
||||||
import { getEcdsaPublicKey } from '@/utils/crypto.ts';
|
import { getEcdsaPublicKey } from '@/utils/crypto.ts';
|
||||||
|
|
||||||
|
|
@ -93,7 +94,7 @@ class Conf {
|
||||||
if (keys) {
|
if (keys) {
|
||||||
const { publicKey } = keys;
|
const { publicKey } = keys;
|
||||||
const bytes = await crypto.subtle.exportKey('raw', publicKey);
|
const bytes = await crypto.subtle.exportKey('raw', publicKey);
|
||||||
return encodeBase64(bytes);
|
return encodeBase64Url(bytes);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue