File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -307,8 +307,7 @@ public extension AuthService {
307
307
let link = url. absoluteString
308
308
309
309
if auth. isSignIn ( withEmailLink: link) {
310
- let anonymousUserID = CommonUtils . getQueryParamValue ( from: link, paramName: " continueUrl " )
311
- . flatMap { CommonUtils . getQueryParamValue ( from: $0, paramName: " ui_auid " ) }
310
+ let anonymousUserID = CommonUtils . getAnonymousUserIdFromUrl ( from: link)
312
311
if shouldHandleAnonymousUpgrade, anonymousUserID == currentUser? . uid {
313
312
let credential = EmailAuthProvider . credential ( withEmail: email, link: link)
314
313
try await handleAutoUpgradeAnonymousUser ( credentials: credential)
Original file line number Diff line number Diff line change @@ -54,4 +54,9 @@ public class CommonUtils {
54
54
55
55
return urlComponents. queryItems? . first ( where: { $0. name == paramName } ) ? . value
56
56
}
57
+
58
+ public static func getAnonymousUserIdFromUrl( from urlString: String ) -> String ? {
59
+ getQueryParamValue ( from: urlString, paramName: " continueUrl " )
60
+ . flatMap { getQueryParamValue ( from: $0, paramName: " ui_auid " ) }
61
+ }
57
62
}
You can’t perform that action at this time.
0 commit comments