Skip to content

Commit eaa5642

Browse files
Merge pull request #1262 from firebase/further-ui-tweaks
2 parents 5fd745e + 2c470a4 commit eaa5642

File tree

4 files changed

+25
-12
lines changed

4 files changed

+25
-12
lines changed

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/AuthServiceError.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
1615
import FirebaseAuth
1716
import SwiftUI
1817

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Services/AuthService.swift

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -296,16 +296,24 @@ public final class AuthService {
296296
}
297297

298298
func sendEmailVerification() async throws {
299-
if currentUser != nil {
300-
do {
301-
// TODO: - can use set user action code settings?
302-
try await currentUser!.sendEmailVerification()
303-
} catch {
304-
errorMessage = string.localizedErrorMessage(
305-
for: error
306-
)
307-
throw error
299+
do {
300+
if let user = currentUser {
301+
// Requires running on MainActor as passing to sendEmailVerification() which is non-isolated
302+
let settings: ActionCodeSettings? = await MainActor.run {
303+
configuration.verifyEmailActionCodeSettings
304+
}
305+
306+
if let settings = settings {
307+
try await user.sendEmailVerification(with: settings)
308+
} else {
309+
try await user.sendEmailVerification()
310+
}
308311
}
312+
} catch {
313+
errorMessage = string.localizedErrorMessage(
314+
for: error
315+
)
316+
throw error
309317
}
310318
}
311319
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/UpdatePassword.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
// Created by Russell Wheatley on 24/04/2025.
2020
//
2121

22+
import FirebaseCore
2223
import SwiftUI
2324

2425
private enum FocusableField: Hashable {
@@ -94,3 +95,9 @@ extension UpdatePasswordView: View {
9495
}
9596
}
9697
}
98+
99+
#Preview {
100+
FirebaseOptions.dummyConfigurationForPreview()
101+
return UpdatePasswordView()
102+
.environment(AuthService())
103+
}

FirebaseSwiftUI/FirebaseFacebookSwiftUI/Sources/Views/SignInWithFacebookButton.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public struct SignInWithFacebookButton {
4242
if trackingAuthorizationStatus == .authorized {
4343
self.limitedLogin = newValue
4444
} else {
45-
self.limitedLogin = false
45+
self.limitedLogin = true
4646
}
4747
}
4848
)
@@ -121,7 +121,6 @@ extension SignInWithFacebookButton: View {
121121
)
122122
}
123123
}
124-
Text(errorMessage).foregroundColor(.red)
125124
}
126125
}
127126

0 commit comments

Comments
 (0)