{"version":3,"file":"okta.mjs","names":[],"sources":["../../../../src/plugins/generic-oauth/providers/okta.ts"],"sourcesContent":["import type { BaseOAuthProviderOptions, GenericOAuthConfig } from \"../index\";\n\nexport interface OktaOptions extends BaseOAuthProviderOptions {\n\t/**\n\t * Okta issuer URL (e.g., https://dev-xxxxx.okta.com/oauth2/default)\n\t * This will be used to construct the discovery URL.\n\t */\n\tissuer: string;\n}\n\n/**\n * Okta OAuth provider helper\n *\n * @example\n * ```ts\n * import { genericOAuth, okta } from \"better-auth/plugins/generic-oauth\";\n *\n * export const auth = betterAuth({\n *   plugins: [\n *     genericOAuth({\n *       config: [\n *         okta({\n *           clientId: process.env.OKTA_CLIENT_ID,\n *           clientSecret: process.env.OKTA_CLIENT_SECRET,\n *           issuer: process.env.OKTA_ISSUER,\n *         }),\n *       ],\n *     }),\n *   ],\n * });\n * ```\n */\nexport function okta(options: OktaOptions): GenericOAuthConfig {\n\tconst defaultScopes = [\"openid\", \"profile\", \"email\"];\n\n\t// Ensure issuer ends without trailing slash for proper discovery URL construction\n\tconst issuer = options.issuer.replace(/\\/$/, \"\");\n\tconst discoveryUrl = `${issuer}/.well-known/openid-configuration`;\n\n\treturn {\n\t\tproviderId: \"okta\",\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,KAAK,SAA0C;AAO9D,QAAO;EACN,YAAY;EACZ,cAJoB,GADN,QAAQ,OAAO,QAAQ,OAAO,GAAG,CACjB;EAK9B,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"}