From 4d84c6a48922209e8b649c206d3d4cc003c8d117 Mon Sep 17 00:00:00 2001 From: Mikkel ALMONTE--RINGAUD Date: Tue, 5 Nov 2024 11:36:54 +0100 Subject: [PATCH] fix: b64 encoding --- src/api/private/otp.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/private/otp.ts b/src/api/private/otp.ts index c01f671..25035bd 100644 --- a/src/api/private/otp.ts +++ b/src/api/private/otp.ts @@ -1,8 +1,8 @@ -import { base64urlnopad } from "@scure/base"; +import { base64url, base64 } from "@scure/base"; import { packBigEndian } from "~/core/pack"; import { hashWithHMAC } from "~/core/hmac"; export const otp = (seed: string, counter: number): string => { const packedCounter = packBigEndian(counter); - return base64urlnopad.encode(hashWithHMAC(packedCounter, base64urlnopad.decode(seed))); + return base64url.encode(hashWithHMAC(packedCounter, base64.decode(seed))); };