@react-native-firebase/auth 21.7.4 → 21.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/lib/version.js +1 -1
- package/package.json +4 -4
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/__tests__/auth.test.ts +0 -395
- package/plugin/__tests__/__snapshots__/iosPlugin_openUrlFix.test.ts.snap +0 -350
- package/plugin/__tests__/__snapshots__/iosPlugin_urlTypes.test.ts.snap +0 -13
- package/plugin/__tests__/fixtures/AppDelegate_bare_sdk43.m +0 -86
- package/plugin/__tests__/fixtures/AppDelegate_fallback.m +0 -46
- package/plugin/__tests__/fixtures/AppDelegate_sdk42.m +0 -102
- package/plugin/__tests__/fixtures/AppDelegate_sdk44.m +0 -79
- package/plugin/__tests__/fixtures/AppDelegate_sdk45.mm +0 -129
- package/plugin/__tests__/fixtures/TestGoogleService-Info.incomplete.plist +0 -6
- package/plugin/__tests__/fixtures/TestGoogleService-Info.plist +0 -38
- package/plugin/__tests__/iosPlugin_openUrlFix.test.ts +0 -343
- package/plugin/__tests__/iosPlugin_urlTypes.test.ts +0 -75
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,16 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [21.9.0](https://github.com/invertase/react-native-firebase/compare/v21.8.0...v21.9.0) (2025-02-11)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @react-native-firebase/auth
|
9
|
+
|
10
|
+
## [21.8.0](https://github.com/invertase/react-native-firebase/compare/v21.7.4...v21.8.0) (2025-02-10)
|
11
|
+
|
12
|
+
### Bug Fixes
|
13
|
+
|
14
|
+
- do not ship unit tests in released packages ([e71dadf](https://github.com/invertase/react-native-firebase/commit/e71dadfc1c0cad2e89c94100913af31ddf7d9c91))
|
15
|
+
|
6
16
|
## [21.7.4](https://github.com/invertase/react-native-firebase/compare/v21.7.3...v21.7.4) (2025-02-08)
|
7
17
|
|
8
18
|
### Bug Fixes
|
package/lib/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
// Generated by genversion.
|
2
|
-
module.exports = '21.
|
2
|
+
module.exports = '21.9.0';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-native-firebase/auth",
|
3
|
-
"version": "21.
|
3
|
+
"version": "21.9.0",
|
4
4
|
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
5
5
|
"description": "React Native Firebase - The authentication module provides an easy-to-use API to integrate an authentication workflow into new and existing applications. React Native Firebase provides access to all Firebase authentication methods and identity providers.",
|
6
6
|
"main": "lib/index.js",
|
@@ -27,12 +27,12 @@
|
|
27
27
|
"plist": "^3.1.0"
|
28
28
|
},
|
29
29
|
"peerDependencies": {
|
30
|
-
"@react-native-firebase/app": "21.
|
30
|
+
"@react-native-firebase/app": "21.9.0",
|
31
31
|
"expo": ">=47.0.0"
|
32
32
|
},
|
33
33
|
"devDependencies": {
|
34
34
|
"@types/plist": "^3.0.5",
|
35
|
-
"expo": "^52.0.
|
35
|
+
"expo": "^52.0.32"
|
36
36
|
},
|
37
37
|
"peerDependenciesMeta": {
|
38
38
|
"expo": {
|
@@ -42,5 +42,5 @@
|
|
42
42
|
"publishConfig": {
|
43
43
|
"access": "public"
|
44
44
|
},
|
45
|
-
"gitHead": "
|
45
|
+
"gitHead": "306d9c766ff5614fff6404be5c3dd4bcdb450754"
|
46
46
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"root":["./src/index.ts","./src/
|
1
|
+
{"root":["./src/index.ts","./src/pluginconfig.ts","./src/ios/index.ts","./src/ios/openurlfix.ts","./src/ios/urltypes.ts"],"version":"5.7.3"}
|
package/__tests__/auth.test.ts
DELETED
@@ -1,395 +0,0 @@
|
|
1
|
-
import { describe, expect, it } from '@jest/globals';
|
2
|
-
|
3
|
-
import auth, {
|
4
|
-
firebase,
|
5
|
-
getAuth,
|
6
|
-
initializeAuth,
|
7
|
-
applyActionCode,
|
8
|
-
beforeAuthStateChanged,
|
9
|
-
checkActionCode,
|
10
|
-
confirmPasswordReset,
|
11
|
-
connectAuthEmulator,
|
12
|
-
createUserWithEmailAndPassword,
|
13
|
-
fetchSignInMethodsForEmail,
|
14
|
-
getMultiFactorResolver,
|
15
|
-
getRedirectResult,
|
16
|
-
isSignInWithEmailLink,
|
17
|
-
onAuthStateChanged,
|
18
|
-
onIdTokenChanged,
|
19
|
-
sendPasswordResetEmail,
|
20
|
-
sendSignInLinkToEmail,
|
21
|
-
setPersistence,
|
22
|
-
signInAnonymously,
|
23
|
-
signInWithCredential,
|
24
|
-
signInWithCustomToken,
|
25
|
-
signInWithEmailAndPassword,
|
26
|
-
signInWithEmailLink,
|
27
|
-
signInWithPhoneNumber,
|
28
|
-
verifyPhoneNumber,
|
29
|
-
signInWithPopup,
|
30
|
-
signInWithRedirect,
|
31
|
-
signOut,
|
32
|
-
updateCurrentUser,
|
33
|
-
useDeviceLanguage,
|
34
|
-
useUserAccessGroup,
|
35
|
-
verifyPasswordResetCode,
|
36
|
-
parseActionCodeURL,
|
37
|
-
deleteUser,
|
38
|
-
getIdToken,
|
39
|
-
getIdTokenResult,
|
40
|
-
linkWithCredential,
|
41
|
-
linkWithPhoneNumber,
|
42
|
-
linkWithPopup,
|
43
|
-
linkWithRedirect,
|
44
|
-
multiFactor,
|
45
|
-
reauthenticateWithCredential,
|
46
|
-
reauthenticateWithPhoneNumber,
|
47
|
-
reauthenticateWithPopup,
|
48
|
-
reauthenticateWithRedirect,
|
49
|
-
reload,
|
50
|
-
sendEmailVerification,
|
51
|
-
unlink,
|
52
|
-
updateEmail,
|
53
|
-
updatePassword,
|
54
|
-
updatePhoneNumber,
|
55
|
-
updateProfile,
|
56
|
-
verifyBeforeUpdateEmail,
|
57
|
-
getAdditionalUserInfo,
|
58
|
-
getCustomAuthDomain,
|
59
|
-
} from '../lib';
|
60
|
-
|
61
|
-
// @ts-ignore - We don't mind missing types here
|
62
|
-
import { NativeFirebaseError } from '../../app/lib/internal';
|
63
|
-
|
64
|
-
describe('Auth', function () {
|
65
|
-
describe('namespace', function () {
|
66
|
-
it('accessible from firebase.app()', function () {
|
67
|
-
const app = firebase.app();
|
68
|
-
expect(app.auth).toBeDefined();
|
69
|
-
expect(app.auth().useEmulator).toBeDefined();
|
70
|
-
});
|
71
|
-
});
|
72
|
-
|
73
|
-
describe('useEmulator()', function () {
|
74
|
-
it('useEmulator requires a string url', function () {
|
75
|
-
// @ts-ignore because we pass an invalid argument...
|
76
|
-
expect(() => auth().useEmulator()).toThrow(
|
77
|
-
'firebase.auth().useEmulator() takes a non-empty string',
|
78
|
-
);
|
79
|
-
expect(() => auth().useEmulator('')).toThrow(
|
80
|
-
'firebase.auth().useEmulator() takes a non-empty string',
|
81
|
-
);
|
82
|
-
// @ts-ignore because we pass an invalid argument...
|
83
|
-
expect(() => auth().useEmulator(123)).toThrow(
|
84
|
-
'firebase.auth().useEmulator() takes a non-empty string',
|
85
|
-
);
|
86
|
-
});
|
87
|
-
|
88
|
-
it('useEmulator requires a well-formed url', function () {
|
89
|
-
// No http://
|
90
|
-
expect(() => auth().useEmulator('localhost:9099')).toThrow(
|
91
|
-
'firebase.auth().useEmulator() takes a non-empty string URL',
|
92
|
-
);
|
93
|
-
// No port
|
94
|
-
expect(() => auth().useEmulator('http://localhost')).toThrow(
|
95
|
-
'firebase.auth().useEmulator() unable to parse host and port from URL',
|
96
|
-
);
|
97
|
-
});
|
98
|
-
|
99
|
-
it('useEmulator -> remaps Android loopback to host', function () {
|
100
|
-
const foo = auth().useEmulator('http://localhost:9099');
|
101
|
-
expect(foo).toEqual(['10.0.2.2', 9099]);
|
102
|
-
|
103
|
-
const bar = auth().useEmulator('http://127.0.0.1:9099');
|
104
|
-
expect(bar).toEqual(['10.0.2.2', 9099]);
|
105
|
-
});
|
106
|
-
|
107
|
-
it('useEmulator allows hyphens in the hostname', function () {
|
108
|
-
const result = auth().useEmulator('http://my-host:9099');
|
109
|
-
expect(result).toEqual(['my-host', 9099]);
|
110
|
-
});
|
111
|
-
});
|
112
|
-
|
113
|
-
describe('tenantId', function () {
|
114
|
-
it('should be able to set tenantId ', function () {
|
115
|
-
const auth = firebase.app().auth();
|
116
|
-
auth.setTenantId('test-id').then(() => {
|
117
|
-
expect(auth.tenantId).toBe('test-id');
|
118
|
-
});
|
119
|
-
});
|
120
|
-
|
121
|
-
it('should throw error when tenantId is a non string object ', async function () {
|
122
|
-
try {
|
123
|
-
await firebase.app().auth().setTenantId(Object());
|
124
|
-
return Promise.reject('It should throw an error');
|
125
|
-
} catch (e: any) {
|
126
|
-
expect(e.message).toBe("firebase.auth().setTenantId(*) expected 'tenantId' to be a string");
|
127
|
-
return Promise.resolve('Error catched');
|
128
|
-
}
|
129
|
-
});
|
130
|
-
});
|
131
|
-
|
132
|
-
describe('getMultiFactorResolver', function () {
|
133
|
-
it('should return null if no resolver object is found', function () {
|
134
|
-
const unknownError = NativeFirebaseError.fromEvent(
|
135
|
-
{
|
136
|
-
code: 'unknown',
|
137
|
-
},
|
138
|
-
'auth',
|
139
|
-
);
|
140
|
-
const actual = auth.getMultiFactorResolver(auth(), unknownError);
|
141
|
-
expect(actual).toBe(null);
|
142
|
-
});
|
143
|
-
|
144
|
-
it('should return null if resolver object is null', function () {
|
145
|
-
const unknownError = NativeFirebaseError.fromEvent(
|
146
|
-
{
|
147
|
-
code: 'unknown',
|
148
|
-
resolver: null,
|
149
|
-
},
|
150
|
-
'auth',
|
151
|
-
);
|
152
|
-
const actual = auth.getMultiFactorResolver(firebase.app().auth(), unknownError);
|
153
|
-
expect(actual).toBe(null);
|
154
|
-
});
|
155
|
-
|
156
|
-
it('should return the resolver object if its found', function () {
|
157
|
-
const resolver = { session: '', hints: [] };
|
158
|
-
const errorWithResolver = NativeFirebaseError.fromEvent(
|
159
|
-
{
|
160
|
-
code: 'multi-factor-auth-required',
|
161
|
-
resolver,
|
162
|
-
},
|
163
|
-
'auth',
|
164
|
-
);
|
165
|
-
const actual = auth.getMultiFactorResolver(firebase.app().auth(), errorWithResolver);
|
166
|
-
// Using expect(actual).toEqual(resolver) causes unexpected errors:
|
167
|
-
// You attempted to use "firebase.app('[DEFAULT]').appCheck" but this module could not be found.
|
168
|
-
expect(actual).not.toBeNull();
|
169
|
-
// @ts-ignore We know actual is not null
|
170
|
-
expect(actual.session).toEqual(resolver.session);
|
171
|
-
// @ts-ignore We know actual is not null
|
172
|
-
expect(actual.hints).toEqual(resolver.hints);
|
173
|
-
// @ts-ignore We know actual is not null
|
174
|
-
expect(actual._auth).not.toBeNull();
|
175
|
-
});
|
176
|
-
});
|
177
|
-
|
178
|
-
describe('modular', function () {
|
179
|
-
it('`getAuth` function is properly exposed to end user', function () {
|
180
|
-
expect(getAuth).toBeDefined();
|
181
|
-
});
|
182
|
-
|
183
|
-
it('`initializeAuth` function is properly exposed to end user', function () {
|
184
|
-
expect(initializeAuth).toBeDefined();
|
185
|
-
});
|
186
|
-
|
187
|
-
it('`applyActionCode` function is properly exposed to end user', function () {
|
188
|
-
expect(applyActionCode).toBeDefined();
|
189
|
-
});
|
190
|
-
|
191
|
-
it('`beforeAuthStateChanged` function is properly exposed to end user', function () {
|
192
|
-
expect(beforeAuthStateChanged).toBeDefined();
|
193
|
-
});
|
194
|
-
|
195
|
-
it('`checkActionCode` function is properly exposed to end user', function () {
|
196
|
-
expect(checkActionCode).toBeDefined();
|
197
|
-
});
|
198
|
-
|
199
|
-
it('`confirmPasswordReset` function is properly exposed to end user', function () {
|
200
|
-
expect(confirmPasswordReset).toBeDefined();
|
201
|
-
});
|
202
|
-
|
203
|
-
it('`connectAuthEmulator` function is properly exposed to end user', function () {
|
204
|
-
expect(connectAuthEmulator).toBeDefined();
|
205
|
-
});
|
206
|
-
|
207
|
-
it('`createUserWithEmailAndPassword` function is properly exposed to end user', function () {
|
208
|
-
expect(createUserWithEmailAndPassword).toBeDefined();
|
209
|
-
});
|
210
|
-
|
211
|
-
it('`fetchSignInMethodsForEmail` function is properly exposed to end user', function () {
|
212
|
-
expect(fetchSignInMethodsForEmail).toBeDefined();
|
213
|
-
});
|
214
|
-
|
215
|
-
it('`getMultiFactorResolver` function is properly exposed to end user', function () {
|
216
|
-
expect(getMultiFactorResolver).toBeDefined();
|
217
|
-
});
|
218
|
-
|
219
|
-
it('`getRedirectResult` function is properly exposed to end user', function () {
|
220
|
-
expect(getRedirectResult).toBeDefined();
|
221
|
-
});
|
222
|
-
|
223
|
-
it('`isSignInWithEmailLink` function is properly exposed to end user', function () {
|
224
|
-
expect(isSignInWithEmailLink).toBeDefined();
|
225
|
-
});
|
226
|
-
|
227
|
-
it('`onAuthStateChanged` function is properly exposed to end user', function () {
|
228
|
-
expect(onAuthStateChanged).toBeDefined();
|
229
|
-
});
|
230
|
-
|
231
|
-
it('`onIdTokenChanged` function is properly exposed to end user', function () {
|
232
|
-
expect(onIdTokenChanged).toBeDefined();
|
233
|
-
});
|
234
|
-
|
235
|
-
it('`sendPasswordResetEmail` function is properly exposed to end user', function () {
|
236
|
-
expect(sendPasswordResetEmail).toBeDefined();
|
237
|
-
});
|
238
|
-
|
239
|
-
it('`sendSignInLinkToEmail` function is properly exposed to end user', function () {
|
240
|
-
expect(sendSignInLinkToEmail).toBeDefined();
|
241
|
-
});
|
242
|
-
|
243
|
-
it('`setPersistence` function is properly exposed to end user', function () {
|
244
|
-
expect(setPersistence).toBeDefined();
|
245
|
-
});
|
246
|
-
|
247
|
-
it('`signInAnonymously` function is properly exposed to end user', function () {
|
248
|
-
expect(signInAnonymously).toBeDefined();
|
249
|
-
});
|
250
|
-
|
251
|
-
it('`signInWithCredential` function is properly exposed to end user', function () {
|
252
|
-
expect(signInWithCredential).toBeDefined();
|
253
|
-
});
|
254
|
-
|
255
|
-
it('`signInWithCustomToken` function is properly exposed to end user', function () {
|
256
|
-
expect(signInWithCustomToken).toBeDefined();
|
257
|
-
});
|
258
|
-
|
259
|
-
it('`signInWithEmailAndPassword` function is properly exposed to end user', function () {
|
260
|
-
expect(signInWithEmailAndPassword).toBeDefined();
|
261
|
-
});
|
262
|
-
|
263
|
-
it('`signInWithEmailLink` function is properly exposed to end user', function () {
|
264
|
-
expect(signInWithEmailLink).toBeDefined();
|
265
|
-
});
|
266
|
-
|
267
|
-
it('`signInWithPhoneNumber` function is properly exposed to end user', function () {
|
268
|
-
expect(signInWithPhoneNumber).toBeDefined();
|
269
|
-
});
|
270
|
-
|
271
|
-
it('`verifyPhoneNumber` function is properly exposed to end user', function () {
|
272
|
-
expect(verifyPhoneNumber).toBeDefined();
|
273
|
-
});
|
274
|
-
|
275
|
-
it('`signInWithPopup` function is properly exposed to end user', function () {
|
276
|
-
expect(signInWithPopup).toBeDefined();
|
277
|
-
});
|
278
|
-
|
279
|
-
it('`signInWithRedirect` function is properly exposed to end user', function () {
|
280
|
-
expect(signInWithRedirect).toBeDefined();
|
281
|
-
});
|
282
|
-
|
283
|
-
it('`signOut` function is properly exposed to end user', function () {
|
284
|
-
expect(signOut).toBeDefined();
|
285
|
-
});
|
286
|
-
|
287
|
-
it('`updateCurrentUser` function is properly exposed to end user', function () {
|
288
|
-
expect(updateCurrentUser).toBeDefined();
|
289
|
-
});
|
290
|
-
|
291
|
-
it('`useDeviceLanguage` function is properly exposed to end user', function () {
|
292
|
-
expect(useDeviceLanguage).toBeDefined();
|
293
|
-
});
|
294
|
-
|
295
|
-
it('`useUserAccessGroup` function is properly exposed to end user', function () {
|
296
|
-
expect(useUserAccessGroup).toBeDefined();
|
297
|
-
});
|
298
|
-
|
299
|
-
it('`verifyPasswordResetCode` function is properly exposed to end user', function () {
|
300
|
-
expect(verifyPasswordResetCode).toBeDefined();
|
301
|
-
});
|
302
|
-
|
303
|
-
it('`parseActionCodeURL` function is properly exposed to end user', function () {
|
304
|
-
expect(parseActionCodeURL).toBeDefined();
|
305
|
-
});
|
306
|
-
|
307
|
-
it('`deleteUser` function is properly exposed to end user', function () {
|
308
|
-
expect(deleteUser).toBeDefined();
|
309
|
-
});
|
310
|
-
|
311
|
-
it('`getIdToken` function is properly exposed to end user', function () {
|
312
|
-
expect(getIdToken).toBeDefined();
|
313
|
-
});
|
314
|
-
|
315
|
-
it('`getIdTokenResult` function is properly exposed to end user', function () {
|
316
|
-
expect(getIdTokenResult).toBeDefined();
|
317
|
-
});
|
318
|
-
|
319
|
-
it('`linkWithCredential` function is properly exposed to end user', function () {
|
320
|
-
expect(linkWithCredential).toBeDefined();
|
321
|
-
});
|
322
|
-
|
323
|
-
it('`linkWithPhoneNumber` function is properly exposed to end user', function () {
|
324
|
-
expect(linkWithPhoneNumber).toBeDefined();
|
325
|
-
});
|
326
|
-
|
327
|
-
it('`linkWithPopup` function is properly exposed to end user', function () {
|
328
|
-
expect(linkWithPopup).toBeDefined();
|
329
|
-
});
|
330
|
-
|
331
|
-
it('`linkWithRedirect` function is properly exposed to end user', function () {
|
332
|
-
expect(linkWithRedirect).toBeDefined();
|
333
|
-
});
|
334
|
-
|
335
|
-
it('`multiFactor` function is properly exposed to end user', function () {
|
336
|
-
expect(multiFactor).toBeDefined();
|
337
|
-
});
|
338
|
-
|
339
|
-
it('`reauthenticateWithCredential` function is properly exposed to end user', function () {
|
340
|
-
expect(reauthenticateWithCredential).toBeDefined();
|
341
|
-
});
|
342
|
-
|
343
|
-
it('`reauthenticateWithPhoneNumber` function is properly exposed to end user', function () {
|
344
|
-
expect(reauthenticateWithPhoneNumber).toBeDefined();
|
345
|
-
});
|
346
|
-
|
347
|
-
it('`reauthenticateWithPopup` function is properly exposed to end user', function () {
|
348
|
-
expect(reauthenticateWithPopup).toBeDefined();
|
349
|
-
});
|
350
|
-
|
351
|
-
it('`reauthenticateWithRedirect` function is properly exposed to end user', function () {
|
352
|
-
expect(reauthenticateWithRedirect).toBeDefined();
|
353
|
-
});
|
354
|
-
|
355
|
-
it('`reload` function is properly exposed to end user', function () {
|
356
|
-
expect(reload).toBeDefined();
|
357
|
-
});
|
358
|
-
|
359
|
-
it('`sendEmailVerification` function is properly exposed to end user', function () {
|
360
|
-
expect(sendEmailVerification).toBeDefined();
|
361
|
-
});
|
362
|
-
|
363
|
-
it('`unlink` function is properly exposed to end user', function () {
|
364
|
-
expect(unlink).toBeDefined();
|
365
|
-
});
|
366
|
-
|
367
|
-
it('`updateEmail` function is properly exposed to end user', function () {
|
368
|
-
expect(updateEmail).toBeDefined();
|
369
|
-
});
|
370
|
-
|
371
|
-
it('`updatePassword` function is properly exposed to end user', function () {
|
372
|
-
expect(updatePassword).toBeDefined();
|
373
|
-
});
|
374
|
-
|
375
|
-
it('`updatePhoneNumber` function is properly exposed to end user', function () {
|
376
|
-
expect(updatePhoneNumber).toBeDefined();
|
377
|
-
});
|
378
|
-
|
379
|
-
it('`updateProfile` function is properly exposed to end user', function () {
|
380
|
-
expect(updateProfile).toBeDefined();
|
381
|
-
});
|
382
|
-
|
383
|
-
it('`verifyBeforeUpdateEmail` function is properly exposed to end user', function () {
|
384
|
-
expect(verifyBeforeUpdateEmail).toBeDefined();
|
385
|
-
});
|
386
|
-
|
387
|
-
it('`getAdditionalUserInfo` function is properly exposed to end user', function () {
|
388
|
-
expect(getAdditionalUserInfo).toBeDefined();
|
389
|
-
});
|
390
|
-
|
391
|
-
it('`getCustomAuthDomain` function is properly exposed to end user', function () {
|
392
|
-
expect(getCustomAuthDomain).toBeDefined();
|
393
|
-
});
|
394
|
-
});
|
395
|
-
});
|