File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,10 @@ export class EmptyCredentialsProvider implements CredentialsProvider {
135
135
}
136
136
}
137
137
138
- /** A CredentialsProvider that always returns a constant token. Used for emulator token mocking. */
138
+ /**
139
+ * A CredentialsProvider that always returns a constant token. Used for
140
+ * emulator token mocking.
141
+ */
139
142
export class EmulatorCredentialsProvider implements CredentialsProvider {
140
143
constructor ( private token : Token ) { }
141
144
Original file line number Diff line number Diff line change @@ -230,6 +230,8 @@ export function getFirestore(app: FirebaseApp = getApp()): FirebaseFirestore {
230
230
* emulator.
231
231
* @param host - the emulator host (ex: localhost).
232
232
* @param port - the emulator port (ex: 9000).
233
+ * @param options.mockUserToken - the mock auth token to use for unit testing
234
+ * Security Rules.
233
235
*/
234
236
export function useFirestoreEmulator (
235
237
firestore : FirebaseFirestore ,
@@ -256,7 +258,8 @@ export function useFirestoreEmulator(
256
258
} ) ;
257
259
258
260
if ( options . mockUserToken ) {
259
- // Let createMockUserToken validate first (catches common mistakes like "uid" and missing sub.)
261
+ // Let createMockUserToken validate first (catches common mistakes like
262
+ // invalid field "uid" and missing field "sub" / "user_id".)
260
263
const token = createMockUserToken ( options . mockUserToken ) ;
261
264
const uid = options . mockUserToken . sub || options . mockUserToken . user_id ;
262
265
if ( ! uid ) {
You can’t perform that action at this time.
0 commit comments