execreate
10/20/2022, 1:34 PM2fa_completed_or_absent
. Everything is okay after I first log in, but after my access token expires (it is set to expire in 15 min) and I refresh my token there is a problem - I get this error from protected API endpoints:
json
{
"message": "invalid claim",
"claimValidationErrors": [
{
"id": "2fa_completed_or_absent",
"reason": {
"message": "wrong value",
"expectedValue": true,
"actualValue": false
}
}
]
}
When I try to decode the access token I can see that it contains the my custom claim and its value is correct:
json
{
"2fa_completed_or_absent": {
"v": true,
"t": 1666271203895
}
}
Do you think validation fails because of the timestamp? How do I avoid this?python
async def get_global_claim_validators(
user_id: str,
claim_validators_added_by_other_recipes: list[SessionClaimValidator],
user_context: Dict[str, Any],
):
return claim_validators_added_by_other_recipes + [SecondFactorCompletedOrAbsentClaim.validators.has_value(True)]
json
{...
"2fa_completed_or_absent": {
"v": false,
"t": 1666273248592
}
...}
False
after token refresh?π€rp
10/20/2022, 2:08 PMexecreate
10/20/2022, 2:19 PMsupertokens-python==0.11.0
, I'll try to update it to the latest version nowrp
10/20/2022, 2:20 PMexecreate
10/20/2022, 2:20 PMsupertokens-python==0.11.0
is already latest version π
rp
10/20/2022, 2:21 PMexecreate
10/20/2022, 2:22 PMrp
10/20/2022, 2:34 PM