File tree Expand file tree Collapse file tree 4 files changed +25
-12
lines changed
FirebaseAuthSwiftUI/Sources
FirebaseFacebookSwiftUI/Sources/Views Expand file tree Collapse file tree 4 files changed +25
-12
lines changed Original file line number Diff line number Diff line change 12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
-
16
15
import FirebaseAuth
17
16
import SwiftUI
18
17
Original file line number Diff line number Diff line change @@ -296,16 +296,24 @@ public final class AuthService {
296
296
}
297
297
298
298
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
+ }
308
311
}
312
+ } catch {
313
+ errorMessage = string. localizedErrorMessage (
314
+ for: error
315
+ )
316
+ throw error
309
317
}
310
318
}
311
319
}
Original file line number Diff line number Diff line change 19
19
// Created by Russell Wheatley on 24/04/2025.
20
20
//
21
21
22
+ import FirebaseCore
22
23
import SwiftUI
23
24
24
25
private enum FocusableField : Hashable {
@@ -94,3 +95,9 @@ extension UpdatePasswordView: View {
94
95
}
95
96
}
96
97
}
98
+
99
+ #Preview {
100
+ FirebaseOptions . dummyConfigurationForPreview ( )
101
+ return UpdatePasswordView ( )
102
+ . environment ( AuthService ( ) )
103
+ }
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public struct SignInWithFacebookButton {
42
42
if trackingAuthorizationStatus == . authorized {
43
43
self . limitedLogin = newValue
44
44
} else {
45
- self . limitedLogin = false
45
+ self . limitedLogin = true
46
46
}
47
47
}
48
48
)
@@ -121,7 +121,6 @@ extension SignInWithFacebookButton: View {
121
121
)
122
122
}
123
123
}
124
- Text ( errorMessage) . foregroundColor ( . red)
125
124
}
126
125
}
127
126
You can’t perform that action at this time.
0 commit comments