Skip to content

Conversation

russellwheatley
Copy link
Member

@russellwheatley russellwheatley commented May 22, 2025

Made some comments for ease of understanding.

Button(action: {
withAnimation {
switchFlow()
ScrollView {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just added ScrollView here. Otherwise, cannot see all options.

}

extension GoogleOperationReauthentication {
@MainActor func reauthenticate() async throws -> AuthenticationToken {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follows near identical logic to Facebook for reauthentication.

try await self.signInWithGoogle(clientID: self.clientID)
}
})
AnyView(SignInWithGoogleButton())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this into separate View, it was directly calling signInWithGoogle which meant it wasn't actually signing in with Firebase and not using AuthService to update currentUser and other aspects of state.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider documenting this in a comment since it's unintuitive looking at the code.

try await operation(on: user)
} else if providerId == "facebook.com" {
try await facebookProvider.deleteUser(user: user)
} else if providerId == "google.com" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These string values should be vended by the upstream Auth SDK as constants if you'd like to use those instead of typing them out: https://firebase.google.com/docs/reference/ios/firebaseauth/api/reference/Constants#firgoogleauthproviderid

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

try await self.signInWithGoogle(clientID: self.clientID)
}
})
AnyView(SignInWithGoogleButton())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider documenting this in a comment since it's unintuitive looking at the code.

@russellwheatley russellwheatley merged commit 1d8ff90 into main May 28, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants