Check tenant access

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-08-05 14:07:57 +02:00
parent 58ea075f0f
commit e49da8b0d9
3 changed files with 49 additions and 6 deletions

View File

@@ -129,11 +129,14 @@ function PublicTrustCenterContent() {
})
.then(response => response.json())
.then((result: GraphQLResponse<PublicTrustCenterData>) => {
if (result.errors && result.errors.some((error: GraphQLError) =>
!error.message.includes('access denied: authentication required')
)) {
throw new Error(result.errors[0].message);
const nonAuthErrors = result.errors?.filter((error: GraphQLError) =>
!error.message.includes('access denied')
) || [];
if (nonAuthErrors.length > 0) {
throw new Error(nonAuthErrors[0].message);
}
setData(result.data || null);
})
.catch(setError)