File tree Expand file tree Collapse file tree 2 files changed +11
-14
lines changed Expand file tree Collapse file tree 2 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -66,10 +66,6 @@ typedef void (^FIRVerifyClientCallback)(FIRAuthAppCredential *_Nullable appCrede
66
66
*/
67
67
typedef void (^FIRFetchAuthDomainCallback)(NSString *_Nullable authDomain,
68
68
NSError *_Nullable error);
69
- /* * @var kAuthDomainSuffix
70
- @brief The suffix of the auth domain pertiaining to a given Firebase project.
71
- */
72
- static NSString *const kAuthDomainSuffix = @" firebaseapp.com" ;
73
69
74
70
/* * @var kauthTypeVerifyApp
75
71
@brief The auth type to be specified in the app verification request.
Original file line number Diff line number Diff line change 23
23
24
24
NS_ASSUME_NONNULL_BEGIN
25
25
26
- /* * @var kAuthDomainSuffix
27
- @brief The suffix of the auth domain pertiaining to a given Firebase project.
28
- */
29
- static NSString *const kAuthDomainSuffix = @" firebaseapp.com" ;
30
-
31
26
@implementation FIRAuthWebUtils
32
27
28
+ + (NSArray <NSString *> *)supportedAuthDomains {
29
+ return @[@" firebaseapp.com" , @" web.app" ];
30
+ }
31
+
33
32
+ (NSString *)randomStringWithLength : (NSUInteger )length {
34
33
NSMutableString *randomString = [[NSMutableString alloc ] init ];
35
34
for (int i=0 ; i < length; i++) {
@@ -99,11 +98,13 @@ + (void)fetchAuthDomainWithRequestConfiguration:(FIRAuthRequestConfiguration *)r
99
98
}
100
99
NSString *authDomain;
101
100
for (NSString *domain in response.authorizedDomains ) {
102
- NSInteger index = domain.length - kAuthDomainSuffix .length ;
103
- if (index >= 2 ) {
104
- if ([domain hasSuffix: kAuthDomainSuffix ] && domain.length >= kAuthDomainSuffix .length + 2 ) {
105
- authDomain = domain;
106
- break ;
101
+ for (NSString *suportedAuthDomain in [self supportedAuthDomains ]) {
102
+ NSInteger index = domain.length - suportedAuthDomain.length ;
103
+ if (index >= 2 ) {
104
+ if ([domain hasSuffix: suportedAuthDomain] && domain.length >= suportedAuthDomain.length + 2 ) {
105
+ authDomain = domain;
106
+ break ;
107
+ }
107
108
}
108
109
}
109
110
}
You can’t perform that action at this time.
0 commit comments