File size: 612 Bytes
cd8bd0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { getSettings } from "@/lib/localDb";
import { isProviderBlockedByIdOrAlias } from "@/shared/utils/noAuthProviders";
import * as log from "../utils/logger";

export async function isNoAuthProviderBlockedBySettings(providerId: string): Promise<boolean> {
  try {
    const settings = await getSettings();
    return isProviderBlockedByIdOrAlias(providerId, settings.blockedProviders);
  } catch (error) {
    log.warn(
      "AUTH",
      `Could not read blocked provider settings for ${providerId}: ${
        error instanceof Error ? error.message : String(error)
      }`
    );
    return false;
  }
}