Skip to content

Commit

Permalink
fix useSigninCheck caps in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jhuleatt committed Aug 17, 2022
1 parent 467cc2b commit 414201e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions docs/reference/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/use.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,12 @@ To check [custom claims](https://firebase.google.com/docs/auth/admin/custom-clai

```jsx
// pass in an object describing the custom claims a user must have
const { status, data: signInCheckResult } = useSignInCheck({ requiredClaims: { superUser: true } });
const { status, data: signInCheckResult } = useSigninCheck({ requiredClaims: { superUser: true } });

// OR

// pass in a custom claims validator function
const { status, data: signInCheckResult } = useSignInCheck({
const { status, data: signInCheckResult } = useSigninCheck({
validateCustomClaims: (userClaims) => {
// custom validation logic...
return {
Expand Down
10 changes: 5 additions & 5 deletions src/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ export interface SignInCheckOptionsClaimsValidator extends SignInCheckOptionsBas
*
* ```ts
* // pass in an object describing the custom claims a user must have
* const {status, data: signInCheckResult} = useSignInCheck({requiredClaims: {admin: true}});
* const {status, data: signInCheckResult} = useSigninCheck({requiredClaims: {admin: true}});
*
* // pass in a custom claims validator function
* const {status, data: signInCheckResult} = useSignInCheck({validateCustomClaims: (userClaims) => {
* const {status, data: signInCheckResult} = useSigninCheck({validateCustomClaims: (userClaims) => {
* // custom validation logic...
* }});
*
* // You can optionally force-refresh the token
* const {status, data: signInCheckResult} = useSignInCheck({forceRefresh: true, requiredClaims: {admin: true}});
* const {status, data: signInCheckResult} = useSigninCheck({forceRefresh: true, requiredClaims: {admin: true}});
* ```
*/
export function useSigninCheck(
Expand Down Expand Up @@ -201,7 +201,7 @@ function getClaimsObjectValidator(requiredClaims: Claims): ClaimsValidator {
}

/**
* @deprecated Use `useSignInCheck` instead
* @deprecated Use `useSigninCheck` instead
*
* Conditionally render children based on [custom claims](https://firebase.google.com/docs/auth/admin/custom-claims).
*
Expand Down Expand Up @@ -238,7 +238,7 @@ export function ClaimsCheck({ user, fallback, children, requiredClaims }: Claims
}

/**
* @deprecated Use `useSignInCheck` instead
* @deprecated Use `useSigninCheck` instead
*
* Conditionally render children based on signed-in status and [custom claims](https://firebase.google.com/docs/auth/admin/custom-claims).
*
Expand Down
2 changes: 1 addition & 1 deletion test/auth.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ describe('Authentication', () => {
claims: requiredClaims,
};

// Extra claim passed to useSignInCheck
// Extra claim passed to useSigninCheck
const { result, waitFor: waitForHookCondition } = renderHook(() => useSigninCheck({ requiredClaims: { ...requiredClaims, anExtraClaim: 'true' } }), {
wrapper: Provider,
});
Expand Down

0 comments on commit 414201e

Please sign in to comment.