Allow to use customClaims in eq_expr
Im developing a multi tenant system using firebase dataconnect and it would be very usefull use a query like this:
query getServices @auth(level: USER) {
services(where: {
tenantId: {eq_expr: "auth.token.tenantId"}
})
{
id
name
}
}
unfurtunately when i run this query i received the message:
query, getServices, services (where.tenantId.eqexpr: StringExpr): unsupported expression "auth.token.tenantId" (currently only "auth.uid" and "uuidV4()" are supported)
2
votes
Victor Sanches Pergher
shared this idea
-
Victor Sanches Pergher commented
is possible already access custom claims by @auth like this
@auth(expr: "auth.token.plan == 'pro'")
i think that is not a huge task implement something like this in 'where'