1export function applyRequiredScopes(scopes: string[] = [], requiredScopes: string[]): string[] {
2  // Add the required scopes for returning profile data.
3  // Remove duplicates
4  return [...new Set([...scopes, ...requiredScopes])];
5}
6
7export function invariantClientId(idName: string, value: any, providerName: string) {
8  if (typeof value === 'undefined')
9    // TODO(Bacon): Add learn more
10    throw new Error(
11      `Client Id property \`${idName}\` must be defined to use ${providerName} auth on this platform.`
12    );
13}
14