Handling Errors

If your interaction hook component determines that the user should not be allowed to continue with the issuance journey (for example, they've failed a biometrics test), you can return an error in your signed JWT which will signal to the issuance journey that it should fail.

Here is an example of how to structure an error JWT:

Copy to clipboard.
1import { SignJWT } from "jose";
3const jwt = await new SignJWT({
4    state: "hJvfiSp3eEGybd-KmL8ja",
5    error: {
6        message: "Insufficient identity assurance level"
7    }

Once signed, this JWT object will be added to the redirect URL used when the user completes the interaction hook journey.