Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
kneth committed Oct 2, 2023
1 parent eb4e578 commit 03ff111
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/realm/src/app-services/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,21 +133,21 @@ export class User<
}

/**
* The provider type used when authenticating the user.
* The provider type used when authenticating the user. If multiple identities exist,
* the provider type for the first identity found is return.
* @returns The provider type as an enumerated string.
* @deprecated Use {@link identities} instead.
*/
get providerType(): ProviderType {
if (this.internal.identities.length > 0) {
const type = this.internal.identities[0].providerType;
if (isProviderType(type)) {
return type;
} else {
throw new Error(`Unexpected provider type: ${type}`);
}
} else {
const [identity] = this.internal.identities;
if (!identity) {
throw new Error("No provider found");
}
const type = identity.providerType;
if (isProviderType(type)) {
return type;
}
throw new Error(`Unexpected provider type: ${type}`);
}

/**
Expand Down

0 comments on commit 03ff111

Please sign in to comment.