-
Notifications
You must be signed in to change notification settings - Fork 896
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
OAuthProvider
is missing constructor
#5392
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
I tried using const twitchAuthProvider = {providerId: 'oidc.twitch'} as AuthProvider;
const result = await signInWithPopup(Auth, twitchAuthProvider); but of course it won't work, because it's not Kinda major bug, can't use custom auth providers with API v9. |
It is a typing issue. The constructor is actually there at runtime. I will work on a fix tomorrow. Can you suppress the ts error as a workaround for now?
|
Two possible workarounds: const FixedOAuthProvider = OAuthProvider as { new(providerId: string): OAuthProvider };
const twitchAuthProvider = new FixedOAuthProvider('oidc.twitch'); or // @ts-ignore
const twitchAuthProvider = new OAuthProvider('oidc.twitch'); |
Yup |
Just ran into this issue on Cordova, @Feiyang1 is it related?:
This should work but errors. Error is being caused here: |
Also none of the above workarounds work for me, that assert still trips even when the console seems to be indicating that the OAuthProvider is a subclass of FederatedProvider... This is broken and a critical issue for us Should also add that our build target is es6, and we're using fuse-box as a bundler |
More investigating... If I remove that above line from the vendor code and just force things through, a browser tab opens with this URL: obfuscated values: API_KEY_GOES_HERE But it's a white screen with the text 'The requested action is invalid.' But when I test on a working version ([email protected]), the url is this: obfuscated values: API_KEY_GOES_HERE, COM.COM.MYAPP, APP_NAME, SESSION_ID This means that the provider is failing both Maybe instead of MY WORKAROUND: Replace all instances of |
It is fixed in @jpike88 Thanks for the report and investigation. It seems to be a different issue than the original one. Can you please open a new issue, so we can track it there properly? |
Environment
9.0.0
auth
Problem
Firebase Auth API v9 does not have
OAuthProvider
constructor, or at least in TypeScript typings.API v9: https://firebase.google.com/docs/reference/js/auth.oauthprovider (no constructor or a way to get new instance
OAuthProvider
)API v8: https://firebase.google.com/docs/reference/js/v8/firebase.auth.OAuthCredential (it's fine at v8)
Even comment docs suggest it should be there (:
I need it as I want to use OIDC (https://cloud.google.com/identity-platform/docs/web/oidc), but no constructor, no
addScope
.The text was updated successfully, but these errors were encountered: