FirebaseExtended / FirebaseExtended/reactfire

`validateCustomClaims` is not re-run when the user claims changes

Open
#493 3 comments 0 reactions 1 assignee Claimed by @jhuleatt View on GitHub
v5
Dominant language
TypeScript
Stars
3.6k
Forks
403
Avg merge
14h 53m
Merged PRs (30d)
5

Description

### Version info

**React:** 17.0.2

**Firebase:** 9.6.1

**ReactFire:** 4.2.1

**Other (e.g. Node, browser, operating system) (if applicable):**

### Test case

```js
const ExamleComponent = () => {
const { data: { hasRequiredClaims } = {} } = useSigninCheck({
validateCustomClaims: (claims) => {
return {
hasRequiredClaims: claims.role === 'admin'
}
}
})

return

{hasRequiredClaims}

}
```

### Steps to reproduce

Add the above call to a React component and login a user with custom claims that match the condition. Trigger a re-render on the above component.

### Expected behavior

Value of `hasRequiredClaims` changes after user is logged in to accurately reflect condition.

### Actual behavior

Value of `hasRequiredClaims` does not change even after the component is re-rendered.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.