Failed to test signature verification
This commit is contained in:
@@ -6,7 +6,7 @@ import merchantNonces from '~/db/schema/merchant_nonces'
|
||||
import { verify } from '~/helpers/signature'
|
||||
import { UnauthenticatedError } from '~/helpers/errors'
|
||||
|
||||
export const apiKey = new Elysia().macro({
|
||||
export const apiKeyAuth = new Elysia().macro({
|
||||
verifyKey: {
|
||||
headers: t.Object({
|
||||
'x-api-key': t.String(),
|
||||
@@ -14,7 +14,7 @@ export const apiKey = new Elysia().macro({
|
||||
'x-signature': t.String(),
|
||||
'x-timestamp': t.Number(),
|
||||
}),
|
||||
|
||||
body: t.Unknown(),
|
||||
async beforeHandle({ headers, body }) {
|
||||
const apiKey = headers['x-api-key']
|
||||
const nonce = headers['x-nonce']
|
||||
|
||||
Reference in New Issue
Block a user