File tree Expand file tree Collapse file tree
e2eTest/FirebaseSwiftUIExample/FirebaseSwiftUIExampleTests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,6 +108,9 @@ func createEmailLinkOnlyUser(email: String) async throws {
108108 try await service. sendEmailSignInLink ( email: email)
109109 let signInLink = try await fetchEmailSignInLinkFromEmulator ( email: email)
110110 try await service. handleSignInLink ( url: signInLink)
111+ try await waitForStateChange {
112+ service. currentUser? . email? . caseInsensitiveCompare ( email) == . orderedSame
113+ }
111114 try await service. signOut ( )
112115}
113116
@@ -152,10 +155,13 @@ func fetchEmailSignInLinkFromEmulator(email: String,
152155 . compactMap ( \. oobLink)
153156 . first
154157
155- if let oobLink,
156- let encodedLink = oobLink. addingPercentEncoding ( withAllowedCharacters: . urlQueryAllowed) ,
157- let wrappedLink = URL ( string: " https://example.com/?link= \( encodedLink) " ) {
158- return wrappedLink
158+ if let oobLink {
159+ var components = URLComponents ( string: " https://example.com/ " )
160+ components? . queryItems = [ URLQueryItem ( name: " link " , value: oobLink) ]
161+
162+ if let wrappedLink = components? . url {
163+ return wrappedLink
164+ }
159165 }
160166
161167 attempts += 1
You can’t perform that action at this time.
0 commit comments