{"version":3,"file":"auth0.mjs","names":[],"sources":["../../../../src/plugins/generic-oauth/providers/auth0.ts"],"sourcesContent":["import type { BaseOAuthProviderOptions, GenericOAuthConfig } from \"../index\";\n\nexport interface Auth0Options extends BaseOAuthProviderOptions {\n\t/**\n\t * Auth0 domain (e.g., dev-xxx.eu.auth0.com)\n\t * This will be used to construct the discovery URL.\n\t */\n\tdomain: string;\n}\n\n/**\n * Auth0 OAuth provider helper\n *\n * @example\n * ```ts\n * import { genericOAuth, auth0 } from \"better-auth/plugins/generic-oauth\";\n *\n * export const auth = betterAuth({\n *   plugins: [\n *     genericOAuth({\n *       config: [\n *         auth0({\n *           clientId: process.env.AUTH0_CLIENT_ID,\n *           clientSecret: process.env.AUTH0_CLIENT_SECRET,\n *           domain: process.env.AUTH0_DOMAIN,\n *         }),\n *       ],\n *     }),\n *   ],\n * });\n * ```\n */\nexport function auth0(options: Auth0Options): GenericOAuthConfig {\n\tconst defaultScopes = [\"openid\", \"profile\", \"email\"];\n\n\t// Ensure domain doesn't have protocol prefix\n\tconst domain = options.domain.replace(/^https?:\\/\\//, \"\");\n\tconst discoveryUrl = `https://${domain}/.well-known/openid-configuration`;\n\n\treturn {\n\t\tproviderId: \"auth0\",\n\t\tdiscoveryUrl,\n\t\tclientId: options.clientId,\n\t\tclientSecret: options.clientSecret,\n\t\tscopes: options.scopes ?? defaultScopes,\n\t\tredirectURI: options.redirectURI,\n\t\tpkce: options.pkce,\n\t\tdisableImplicitSignUp: options.disableImplicitSignUp,\n\t\tdisableSignUp: options.disableSignUp,\n\t\toverrideUserInfo: options.overrideUserInfo,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAgB,MAAM,SAA2C;AAOhE,QAAO;EACN,YAAY;EACZ,cAJoB,WADN,QAAQ,OAAO,QAAQ,gBAAgB,GAAG,CAClB;EAKtC,UAAU,QAAQ;EAClB,cAAc,QAAQ;EACtB,QAAQ,QAAQ,UAXK;GAAC;GAAU;GAAW;GAAQ;EAYnD,aAAa,QAAQ;EACrB,MAAM,QAAQ;EACd,uBAAuB,QAAQ;EAC/B,eAAe,QAAQ;EACvB,kBAAkB,QAAQ;EAC1B"}