Skip to content
Draft
Changes from all commits
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
updated error messaging for auth-api-request.getAccountInfoByFederate…
…dUid()

The previous error handling for the getAccountInfoByFederatedUid() method was misleading. In scenarios where the providerId was valid, but the uid was missing or invalid, the system would still return a "invalid-provider-id" error code. Now, the appropriate error code will be returned depending on which validation is failing.
  • Loading branch information
Remzi Zayid committed Sep 15, 2023
commit b070c702565964d17b93397daf4054bd6af8e991
4 changes: 3 additions & 1 deletion src/auth/auth-api-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1152,8 +1152,10 @@ export abstract class AbstractAuthRequestHandler {
}

public getAccountInfoByFederatedUid(providerId: string, rawId: string): Promise<object> {
if (!validator.isNonEmptyString(providerId) || !validator.isNonEmptyString(rawId)) {
if (!validator.isNonEmptyString(providerId)) {
throw new FirebaseAuthError(AuthClientErrorCode.INVALID_PROVIDER_ID);
} else if (!validator.isNonEmptyString(rawId)) {
throw new FirebaseAuthError(AuthClientErrorCode.INVALID_UID);
}

const request = {
Expand Down