Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[auth-swift] Fix Component warning #12269

Merged
merged 2 commits into from
Jan 20, 2024
Merged

Conversation

paulb777
Copy link
Member

@paulb777 paulb777 commented Jan 13, 2024

This fixes the following console log warning:

10.20.0 - [FirebaseCore][I-COR000030] An instance conforming to FIRAuthProvider was requested, but the instance provided does not conform to the protocol

@google-oss-bot
Copy link

1 Warning
⚠️ Did you forget to add a changelog entry? (Add #no-changelog to the PR description to silence this warning.)

Generated by 🚫 Danger

@paulb777 paulb777 force-pushed the pb-fix-component-warning branch from adfad04 to 2dd98ae Compare January 13, 2024 16:01
@paulb777 paulb777 force-pushed the pb-fix-component-warning branch from 2dd98ae to 998853a Compare January 13, 2024 16:12
@@ -168,7 +168,7 @@ extension Auth: AuthInterop {
@return The `Auth` instance associated with the given app.
*/
@objc open class func auth(app: FirebaseApp) -> Auth {
return ComponentType<AuthProvider>.instance(for: AuthProvider.self, in: app.container) as! Auth
return ComponentType<AuthProvider>.instance(for: AuthProvider.self, in: app.container).auth()
Copy link
Member Author

Choose a reason for hiding this comment

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

Now the type can be right here, since we return an AuthComponent instead of an Auth below.

return Auth(app: app)
let newComponent = AuthComponent(app: app)
// Set up instances early enough so User on keychain will be decoded.
newComponent.auth()
Copy link
Member Author

Choose a reason for hiding this comment

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

Without doing this priming, User will not be initialized from the keychain

@paulb777 paulb777 requested a review from ncooke3 January 16, 2024 14:51
@paulb777
Copy link
Member Author

Merging here. I'll address any comments in a subsequent PR

@paulb777 paulb777 merged commit 1914f6d into auth-swift Jan 20, 2024
48 checks passed
@paulb777 paulb777 deleted the pb-fix-component-warning branch January 20, 2024 17:19
@firebase firebase locked and limited conversation to collaborators Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants