Skip to content
LogoLogo

Challenge.verify

Verify a Challenge HMAC

Verifies that a Challenge ID matches the expected HMAC for the given parameters.

Use the same server-managed secret that produced the Challenge ID.

Usage

import {  } from 'mppx'
 
const  = ..!
 
const  = .({
  : 'charge',
  : 'tempo',
  : 'mpp.dev',
  : { : '1000000', : '0x...', : '0x...' },
  ,
})
 
const  = .(, {  })
// => true

Return type

type ReturnType = boolean

true if the Challenge ID is valid, false otherwise.

Parameters

challenge

  • Type: Challenge

The Challenge to verify.

options

secretKey

  • Type: string

Server secret for HMAC-bound Challenge ID verification. Keep it server-side and load it from your environment or secret manager.