FirebaseExtended / FirebaseExtended/reactfire

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

Abierto
#493 3 comentarios 0 reacciones 1 asignado Reclamado por @jhuleatt Ver en GitHub
v5
Lenguaje dominante
TypeScript
Estrellas
3.6k
Forks
403
Merge medio
14 h 53 min
PR fusionados (30 d)
5

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.