File tree Expand file tree Collapse file tree
FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -307,8 +307,7 @@ public extension AuthService {
307307 let link = url. absoluteString
308308
309309 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)
312311 if shouldHandleAnonymousUpgrade, anonymousUserID == currentUser? . uid {
313312 let credential = EmailAuthProvider . credential ( withEmail: email, link: link)
314313 try await handleAutoUpgradeAnonymousUser ( credentials: credential)
Original file line number Diff line number Diff line change @@ -54,4 +54,9 @@ public class CommonUtils {
5454
5555 return urlComponents. queryItems? . first ( where: { $0. name == paramName } ) ? . value
5656 }
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+ }
5762}
You can’t perform that action at this time.
0 commit comments