hasura-auth
hasura-auth copied to clipboard
Cannot use custom claim array values
First I have defined custom claim like this:
AUTH_JWT_CUSTOM_CLAIMS: '{"my-property-ids":"properties.id"}'
When user have properties, in the token I expect to have array with the IDs of these properties
I update table permissions like following:
Scenario 1: When there's no matching property IDs
{
"errors": [
{
"extensions": {
"code": "data-exception",
"path": "$"
},
"message": "malformed array literal: \"null\""
}
]
}
Scenario 2: When there's only one matching property ID
{
"errors": [
{
"extensions": {
"code": "data-exception",
"path": "$"
},
"message": "malformed array literal: \"AuSoCKNydqpMqCGEixTdQ\""
}
]
}
Scenario 3: When there's more then one matching property IDs
Everything looks to be working.
Is there something I'm doing wrong?
You'd rather try
AUTH_JWT_CUSTOM_CLAIMS: '{"my-property-ids":"properties[].id"}'
JSONata's official documentation
@plmercereau nhost cloud permission variables does not allow the capture of square brackets []. how does one handle this ?
The Nhost cloud is being updated, it will be available soon. We also need to upgrade its hasura-auth version to 0.12
Reopening this issue until this is solved in the cloud
Hasura-auth 0.13.2
is deployed in the cloud. Closing. Thanks for your patience