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
6666 */
6767typedef void (^FIRFetchAuthDomainCallback)(NSString *_Nullable authDomain,
6868 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" ;
7369
7470/* * @var kauthTypeVerifyApp
7571 @brief The auth type to be specified in the app verification request.
Original file line number Diff line number Diff line change 2323
2424NS_ASSUME_NONNULL_BEGIN
2525
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-
3126@implementation FIRAuthWebUtils
3227
28+ + (NSArray <NSString *> *)supportedAuthDomains {
29+ return @[@" firebaseapp.com" , @" web.app" ];
30+ }
31+
3332+ (NSString *)randomStringWithLength : (NSUInteger )length {
3433 NSMutableString *randomString = [[NSMutableString alloc ] init ];
3534 for (int i=0 ; i < length; i++) {
@@ -99,11 +98,13 @@ + (void)fetchAuthDomainWithRequestConfiguration:(FIRAuthRequestConfiguration *)r
9998 }
10099 NSString *authDomain;
101100 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+ }
107108 }
108109 }
109110 }
You can’t perform that action at this time.
0 commit comments