Namespace in prep for a new method for unpadded
This commit is contained in:
@@ -34,7 +34,7 @@ export async function decryptAndStoreToken(
|
||||
const decryptedTokenBytes = await cryptoWorker.fromB64(
|
||||
urlUnsafeB64DecryptedToken,
|
||||
);
|
||||
decryptedToken = await cryptoWorker.toURLSafeB64(decryptedTokenBytes);
|
||||
decryptedToken = await cryptoWorker.toB64URLSafe(decryptedTokenBytes);
|
||||
setData(LS_KEYS.USER, {
|
||||
...user,
|
||||
token: decryptedToken,
|
||||
|
||||
@@ -195,8 +195,8 @@ export class DedicatedCryptoWorker {
|
||||
return libsodium.toB64(data);
|
||||
}
|
||||
|
||||
async toURLSafeB64(data: Uint8Array) {
|
||||
return libsodium.toURLSafeB64(data);
|
||||
async toB64URLSafe(data: Uint8Array) {
|
||||
return libsodium.toB64URLSafe(data);
|
||||
}
|
||||
|
||||
async fromB64(string: string) {
|
||||
|
||||
@@ -398,10 +398,10 @@ export async function toB64(input: Uint8Array) {
|
||||
return sodium.to_base64(input, sodium.base64_variants.ORIGINAL);
|
||||
}
|
||||
|
||||
export async function toURLSafeB64(input: Uint8Array) {
|
||||
export const toB64URLSafe = async (input: Uint8Array) => {
|
||||
await sodium.ready;
|
||||
return sodium.to_base64(input, sodium.base64_variants.URLSAFE);
|
||||
}
|
||||
};
|
||||
|
||||
export async function fromUTF8(input: string) {
|
||||
await sodium.ready;
|
||||
|
||||
Reference in New Issue
Block a user