Discussions

Ask a Question
Back to All

Where can I find out the jwt?

I am trying to decrypt the Webhook data via Access token. I can get the Access token from transak, but not sure where I can get the JWT to verify the data.

This is my code snippets.

    // Get Access Token
    const accessToken = await getAccessToken();
    console.log("======================= Access Token ======================", accessToken);

    if (!accessToken) {
      // Return response with error
      res.status(400).json({ error: 'Failed to get Access Token.' })
    }

    // Verify the request is coming from Transak
    const payload = jwt.verify(req.body.data, accessToken);

This code shows me the error.

======================= Access Token ====================== eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBUElfS0VZIjoiY2RlMzVjODktMjViZS00ODE1LWEzMzUtMTAwN2E3NmY4OTUxIiwiaWF0IjoxNjkwMjIwMDU0LCJleHAiOjE2OTA4MjQ4NTR9.hwphSo3iLsw-RzHNzx6QAUCRmoETLhQ8GqUbqo9SSKw
JsonWebTokenError: jwt must be provided

Can you please give me advice?

Best

ο»Ώ