Verify JWT
If you intend to implement may wish to use the same authentication on your server-side to save you having to do authentication yourself as the claims hold the Ethereum address in it; the issue you would face is verifying that token is actually signed by the server and the user or if it has just been generated and is not secure. This endpoint solves this for you.
Invocation
const isVerified = await lensClient.authentication.verify(accessToken);
query Query {
verify(request: {
accessToken: "eyJhbGmiOiJIUzI1NiIsInR5cCI2IkpXVCJ9.eyJpZCI6IjB4RUVBMEMxZjVhYjAxNTlkYmE3NDlEYzBCQWVlNDYyRTVlMjkzZGFhRiIsInJvbGUiOiJub3JtYWwiLCJpYXQiOjE2NDUxODg5OTQsImV4cCI6MTY2MzE4ODk5NH0.dgO9L5NxlVG_8Mc7H-1VFTIYQDRm_I-KCe2nvkLpx5o"
})
}
Response
{
"data": {
"verify": true
}
}
Full LensClient Example
const accessToken = "YOUR_ACCESS_TOKEN";
const isVerified = await lensClient.authentication.verify(accessToken);
console.log(`Token is ${isVerified ? "valid" : "invalid"}`);
Full GraphQL API Example
Updated about 1 month ago