FirebaseExtended / FirebaseExtended/reactfire

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

Đang mở
#493 3 bình luận 0 reaction 1 người được giao Được @jhuleatt nhận Xem trên GitHub
v5
Ngôn ngữ chính
TypeScript
Star
3.6k
Fork
403
Merge trung bình
14 giờ 53 phút
Pull request đã merge (30 ngày)
5

Mô tả

### 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.