Skip to content

Commit 8fe4435

Browse files
authored
New Auth Hook: useSigninCheck() to replace AuthCheck and ClaimsCheck components (#368)
1 parent 8e8680e commit 8fe4435

18 files changed

+1107
-48
lines changed
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
[ReactFire reference docs](../README.md) / [index](../modules/index.md) / ReactFireError
2+
3+
# Class: ReactFireError
4+
5+
[index](../modules/index.md).ReactFireError
6+
7+
## Hierarchy
8+
9+
* *Error*
10+
11+
**ReactFireError**
12+
13+
## Table of contents
14+
15+
### Constructors
16+
17+
- [constructor](index.reactfireerror.md#constructor)
18+
19+
### Properties
20+
21+
- [code](index.reactfireerror.md#code)
22+
- [customData](index.reactfireerror.md#customdata)
23+
- [message](index.reactfireerror.md#message)
24+
- [name](index.reactfireerror.md#name)
25+
- [stack](index.reactfireerror.md#stack)
26+
- [prepareStackTrace](index.reactfireerror.md#preparestacktrace)
27+
- [stackTraceLimit](index.reactfireerror.md#stacktracelimit)
28+
29+
### Methods
30+
31+
- [captureStackTrace](index.reactfireerror.md#capturestacktrace)
32+
33+
## Constructors
34+
35+
### constructor
36+
37+
\+ **new ReactFireError**(`code`: *string*, `message`: *string*, `customData?`: *Record*<string, unknown\>): [*ReactFireError*](index.reactfireerror.md)
38+
39+
#### Parameters:
40+
41+
| Name | Type |
42+
| :------ | :------ |
43+
| `code` | *string* |
44+
| `message` | *string* |
45+
| `customData?` | *Record*<string, unknown\> |
46+
47+
**Returns:** [*ReactFireError*](index.reactfireerror.md)
48+
49+
Overrides: Error.constructor
50+
51+
Defined in: [src/index.ts:11](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L11)
52+
53+
## Properties
54+
55+
### code
56+
57+
`Readonly` **code**: *string*
58+
59+
___
60+
61+
### customData
62+
63+
`Optional` **customData**: *Record*<string, unknown\>
64+
65+
___
66+
67+
### message
68+
69+
**message**: *string*
70+
71+
Inherited from: Error.message
72+
73+
Defined in: node_modules/typescript/lib/lib.es5.d.ts:974
74+
75+
___
76+
77+
### name
78+
79+
`Readonly` **name**: ``"ReactFireError"``= 'ReactFireError'
80+
81+
Overrides: Error.name
82+
83+
Defined in: [src/index.ts:11](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L11)
84+
85+
___
86+
87+
### stack
88+
89+
`Optional` **stack**: *string*
90+
91+
Inherited from: Error.stack
92+
93+
Defined in: node_modules/typescript/lib/lib.es5.d.ts:975
94+
95+
___
96+
97+
### prepareStackTrace
98+
99+
`Static` `Optional` **prepareStackTrace**: (`err`: Error, `stackTraces`: CallSite[]) => *any*
100+
101+
Optional override for formatting stack traces
102+
103+
**`see`** https://v8.dev/docs/stack-trace-api#customizing-stack-traces
104+
105+
#### Type declaration:
106+
107+
▸ (`err`: Error, `stackTraces`: CallSite[]): *any*
108+
109+
#### Parameters:
110+
111+
| Name | Type |
112+
| :------ | :------ |
113+
| `err` | Error |
114+
| `stackTraces` | CallSite[] |
115+
116+
**Returns:** *any*
117+
118+
Defined in: node_modules/@types/node/globals.d.ts:11
119+
120+
Inherited from: Error.prepareStackTrace
121+
122+
Defined in: node_modules/@types/node/globals.d.ts:11
123+
124+
___
125+
126+
### stackTraceLimit
127+
128+
`Static` **stackTraceLimit**: *number*
129+
130+
Inherited from: Error.stackTraceLimit
131+
132+
Defined in: node_modules/@types/node/globals.d.ts:13
133+
134+
## Methods
135+
136+
### captureStackTrace
137+
138+
`Static`**captureStackTrace**(`targetObject`: *object*, `constructorOpt?`: Function): *void*
139+
140+
Create .stack property on a target object
141+
142+
#### Parameters:
143+
144+
| Name | Type |
145+
| :------ | :------ |
146+
| `targetObject` | *object* |
147+
| `constructorOpt?` | Function |
148+
149+
**Returns:** *void*
150+
151+
Inherited from: Error.captureStackTrace
152+
153+
Defined in: node_modules/@types/node/globals.d.ts:4

docs/reference/interfaces/auth.authcheckprops.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@
1818

1919
**children**: ReactNode
2020

21-
Defined in: [src/auth.tsx:54](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L54)
21+
Defined in: [src/auth.tsx:55](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L55)
2222

2323
___
2424

2525
### fallback
2626

2727
**fallback**: ReactNode
2828

29-
Defined in: [src/auth.tsx:53](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L53)
29+
Defined in: [src/auth.tsx:54](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L54)
3030

3131
___
3232

3333
### requiredClaims
3434

3535
`Optional` **requiredClaims**: Object
3636

37-
Defined in: [src/auth.tsx:55](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L55)
37+
Defined in: [src/auth.tsx:56](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L56)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[ReactFire reference docs](../README.md) / [auth](../modules/auth.md) / ClaimCheckErrors
2+
3+
# Interface: ClaimCheckErrors
4+
5+
[auth](../modules/auth.md).ClaimCheckErrors
6+
7+
## Indexable
8+
9+
[key: *string*]: *any*[]

docs/reference/interfaces/auth.claimscheckprops.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,30 @@
1919

2020
**children**: ReactNode
2121

22-
Defined in: [src/auth.tsx:61](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L61)
22+
Defined in: [src/auth.tsx:62](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L62)
2323

2424
___
2525

2626
### fallback
2727

2828
**fallback**: ReactNode
2929

30-
Defined in: [src/auth.tsx:60](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L60)
30+
Defined in: [src/auth.tsx:61](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L61)
3131

3232
___
3333

3434
### requiredClaims
3535

36-
`Optional` **requiredClaims**: *object*
36+
**requiredClaims**: *object*
3737

3838
#### Type declaration:
3939

40-
Defined in: [src/auth.tsx:62](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L62)
40+
Defined in: [src/auth.tsx:63](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L63)
4141

4242
___
4343

4444
### user
4545

4646
**user**: User
4747

48-
Defined in: [src/auth.tsx:59](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L59)
48+
Defined in: [src/auth.tsx:60](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L60)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[ReactFire reference docs](../README.md) / [auth](../modules/auth.md) / ClaimsValidator
2+
3+
# Interface: ClaimsValidator
4+
5+
[auth](../modules/auth.md).ClaimsValidator
6+
7+
## Callable
8+
9+
**ClaimsValidator**(`claims`: { [key: string]: *any*; }): *object*
10+
11+
#### Parameters:
12+
13+
| Name | Type |
14+
| :------ | :------ |
15+
| `claims` | *object* |
16+
17+
**Returns:** *object*
18+
19+
| Name | Type |
20+
| :------ | :------ |
21+
| `errors` | {} \| [*ClaimCheckErrors*](auth.claimcheckerrors.md) |
22+
| `hasRequiredClaims` | *boolean* |
23+
24+
Defined in: [src/auth.tsx:92](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L92)
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
[ReactFire reference docs](../README.md) / [auth](../modules/auth.md) / SignInCheckOptionsBasic
2+
3+
# Interface: SignInCheckOptionsBasic
4+
5+
[auth](../modules/auth.md).SignInCheckOptionsBasic
6+
7+
## Hierarchy
8+
9+
* [*ReactFireOptions*](index.reactfireoptions.md)<[*SigninCheckResult*](../modules/auth.md#signincheckresult)\>
10+
11+
**SignInCheckOptionsBasic**
12+
13+
↳↳ [*SignInCheckOptionsClaimsObject*](auth.signincheckoptionsclaimsobject.md)
14+
15+
↳↳ [*SignInCheckOptionsClaimsValidator*](auth.signincheckoptionsclaimsvalidator.md)
16+
17+
## Table of contents
18+
19+
### Properties
20+
21+
- [forceRefresh](auth.signincheckoptionsbasic.md#forcerefresh)
22+
- [idField](auth.signincheckoptionsbasic.md#idfield)
23+
- [initialData](auth.signincheckoptionsbasic.md#initialdata)
24+
- [startWithValue](auth.signincheckoptionsbasic.md#startwithvalue)
25+
- [suspense](auth.signincheckoptionsbasic.md#suspense)
26+
27+
## Properties
28+
29+
### forceRefresh
30+
31+
`Optional` **forceRefresh**: *boolean*
32+
33+
Defined in: [src/auth.tsx:85](https://github.com/FirebaseExtended/reactfire/blob/main/src/auth.tsx#L85)
34+
35+
___
36+
37+
### idField
38+
39+
`Optional` **idField**: *string*
40+
41+
Inherited from: [ReactFireOptions](index.reactfireoptions.md).[idField](index.reactfireoptions.md#idfield)
42+
43+
Defined in: [src/index.ts:23](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L23)
44+
45+
___
46+
47+
### initialData
48+
49+
`Optional` **initialData**: *any*
50+
51+
Inherited from: [ReactFireOptions](index.reactfireoptions.md).[initialData](index.reactfireoptions.md#initialdata)
52+
53+
Defined in: [src/index.ts:24](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L24)
54+
55+
___
56+
57+
### startWithValue
58+
59+
`Optional` **startWithValue**: *any*
60+
61+
**`deprecated`** use initialData instead
62+
63+
Inherited from: [ReactFireOptions](index.reactfireoptions.md).[startWithValue](index.reactfireoptions.md#startwithvalue)
64+
65+
Defined in: [src/index.ts:28](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L28)
66+
67+
___
68+
69+
### suspense
70+
71+
`Optional` **suspense**: *boolean*
72+
73+
Inherited from: [ReactFireOptions](index.reactfireoptions.md).[suspense](index.reactfireoptions.md#suspense)
74+
75+
Defined in: [src/index.ts:29](https://github.com/FirebaseExtended/reactfire/blob/main/src/index.ts#L29)

0 commit comments

Comments
 (0)