You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: API.md
+31-12Lines changed: 31 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,26 +169,45 @@ ref.flush(); // added foo after null
169
169
170
170
Authentication methods for simulating changes to the auth state of a Firebase reference.
171
171
172
-
##### `changeAuthState(authData)` -> `undefined`
172
+
##### `changeAuthState(user)` -> `undefined`
173
173
174
-
Changes the active authentication credentials to the `authData` object. Before changing the authentication state, `changeAuthState` checks whether the `authData` object is deeply equal to the current authentication data. `onAuth` listeners will only be triggered if the data is not deeply equal. To simulate no user being authenticated, pass `null` for `authData`. This operation is queued until the next `flush`.
174
+
Changes the active authentication credentials to the `authData` object.
175
+
Before changing the authentication state, `changeAuthState` checks the
176
+
`user` object against the current authentication data.
177
+
`onAuthStateChanged` listeners will only be triggered if the data is not
178
+
deeply equal.
175
179
176
-
`authData` should adhere to the [documented schema](https://www.firebase.com/docs/web/api/firebase/onauth.html).
180
+
To simulate no user being authenticated, pass `null` for `user`.
181
+
This operation is queued until the next `flush`.
177
182
178
183
Example:
179
184
180
185
```js
181
-
ref.changeAuthState({
186
+
ref.changeAuthState(newUser(ref, {
182
187
uid:'theUid',
183
-
provider:'github',
184
-
token:'theToken',
185
-
expires:Math.floor(newDate() /1000) +24*60*60, // expire in 24 hours
0 commit comments