-
Notifications
You must be signed in to change notification settings - Fork 944
Big refactor of reauth / link + basic idp tasks #3242
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
Conversation
Binary Size ReportAffected SDKs
Test Logs
|
}; | ||
} | ||
|
||
export async function _signIn(params: IdpTaskParams): Promise<UserCredential> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: _signInWithIdp
@@ -46,4 +48,10 @@ export class UserCredentialImpl implements UserCredential { | |||
// updateAdditionalUserInfoFromIdTokenResponse(userCred, idTokenResponse); | |||
return userCred; | |||
} | |||
|
|||
static async _forOperation(user: User, operationType: externs.OperationType, response: PhoneOrOauthTokenResponse): Promise<UserCredentialImpl> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we also use this for SIGN_IN?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me clean this up in a separate PR. The credential
param in _fromIdTokenResponse
shouldn't be set as the credential
field in the UserCredential
object. Instead, it is just used to determine "isAnonymous". I will consolidate all of this into one method later
const response = await signInWithIdp(auth, request); | ||
|
||
const credential = _authCredentialFromTokenResponse(response); | ||
const userCredential = await UserCredentialImpl._fromIdTokenResponse( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use _forOperation here? then you can fold the logic for _authCredentialFromTokenResponse and only have it used in one place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing too is that _forOperation doesn't init a user object, which we do need for sign in.
Didn't mean to close it -_- |
* Big refactor of reauth / link + basic idp tasks * PR feedback * Formatting
No description provided.