Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -169,19 +169,19 @@ public final class AuthService {

public func signIn(credentials credentials: AuthCredential) async throws {
authenticationState = .authenticating
if currentUser?.isAnonymous == true, configuration.shouldAutoUpgradeAnonymousUsers {
try await linkAccounts(credentials: credentials)
} else {
do {
do {
if currentUser?.isAnonymous == true, configuration.shouldAutoUpgradeAnonymousUsers {
try await linkAccounts(credentials: credentials)
} else {
try await auth.signIn(with: credentials)
updateAuthenticationState()
} catch {
authenticationState = .unauthenticated
errorMessage = string.localizedErrorMessage(
for: error
)
throw error
}
} catch {
authenticationState = .unauthenticated
errorMessage = string.localizedErrorMessage(
for: error
)
throw error
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct ContentView: View {
let authService: AuthService

init() {
// Auth.auth().signInAnonymously()
Auth.auth().signInAnonymously()

let actionCodeSettings = ActionCodeSettings()
actionCodeSettings.handleCodeInApp = true
Expand Down