create-croissant 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/package.json +16 -8
- package/template/.prettierignore +10 -0
- package/template/.prettierrc +11 -0
- package/template/README.md +88 -0
- package/template/apps/web/.env.example +4 -0
- package/template/apps/web/components.json +23 -0
- package/template/apps/web/drizzle.config.ts +11 -0
- package/template/apps/web/eslint.config.js +10 -0
- package/template/apps/web/node_modules/@better-auth/core/LICENSE.md +20 -0
- package/template/apps/web/node_modules/@better-auth/core/README.md +17 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/api/index.d.mts +278 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/api/index.mjs +56 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/async_hooks/index.d.mts +6 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/async_hooks/index.mjs +20 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/async_hooks/pure.index.d.mts +6 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/async_hooks/pure.index.mjs +33 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/endpoint-context.d.mts +18 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/endpoint-context.mjs +29 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/global.d.mts +6 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/global.mjs +36 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/index.d.mts +5 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/index.mjs +5 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/request-state.d.mts +27 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/request-state.mjs +47 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/transaction.d.mts +24 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/context/transaction.mjs +93 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/factory.d.mts +17 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/factory.mjs +754 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-default-field-name.d.mts +18 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-default-field-name.mjs +36 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-default-model-name.d.mts +12 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-default-model-name.mjs +30 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-field-attributes.d.mts +26 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-field-attributes.mjs +37 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-field-name.d.mts +18 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-field-name.mjs +31 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-id-field.d.mts +36 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-id-field.mjs +64 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-model-name.d.mts +12 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-model-name.mjs +21 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/index.d.mts +525 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/index.mjs +24 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/types.d.mts +105 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/utils.d.mts +7 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/utils.mjs +37 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/get-tables.d.mts +6 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/get-tables.mjs +265 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/index.d.mts +10 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/index.mjs +8 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/plugin.d.mts +12 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/account.d.mts +28 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/account.mjs +17 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/rate-limit.d.mts +18 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/rate-limit.mjs +9 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/session.d.mts +23 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/session.mjs +12 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/shared.d.mts +10 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/shared.mjs +9 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/user.d.mts +22 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/user.mjs +11 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/verification.d.mts +21 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/verification.mjs +10 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/db/type.d.mts +167 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/env/color-depth.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/env/color-depth.mjs +86 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/env/env-impl.d.mts +32 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/env/env-impl.mjs +81 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/env/index.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/env/index.mjs +4 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/env/logger.d.mts +48 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/env/logger.mjs +79 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/error/codes.d.mts +68 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/error/codes.mjs +54 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/error/index.d.mts +19 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/error/index.mjs +27 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/index.d.mts +9 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/index.mjs +1 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/api.mjs +12 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/attributes.d.mts +11 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/attributes.mjs +10 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/index.d.mts +3 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/index.mjs +3 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/noop.mjs +42 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/pure.index.d.mts +7 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/pure.index.mjs +7 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/tracer.d.mts +13 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/tracer.mjs +53 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/client-credentials-token.d.mts +56 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/client-credentials-token.mjs +64 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/create-authorization-url.d.mts +44 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/create-authorization-url.mjs +41 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/index.d.mts +8 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/index.mjs +7 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/oauth-provider.d.mts +192 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/refresh-access-token.d.mts +54 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/refresh-access-token.mjs +73 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/utils.d.mts +16 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/utils.mjs +37 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/validate-authorization-code.d.mts +85 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/validate-authorization-code.mjs +79 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/verify.d.mts +42 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/verify.mjs +92 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/apple.d.mts +126 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/apple.mjs +107 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/atlassian.d.mts +70 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/atlassian.mjs +80 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/cognito.d.mts +85 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/cognito.mjs +162 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/discord.d.mts +124 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/discord.mjs +62 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/dropbox.d.mts +69 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/dropbox.mjs +72 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/facebook.d.mts +79 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/facebook.mjs +124 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/figma.d.mts +61 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/figma.mjs +83 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/github.d.mts +102 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/github.mjs +92 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/gitlab.d.mts +123 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/gitlab.mjs +79 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/google.d.mts +97 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/google.mjs +109 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/huggingface.d.mts +83 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/huggingface.mjs +73 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/index.d.mts +1834 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/index.mjs +78 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/kakao.d.mts +161 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/kakao.mjs +70 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/kick.d.mts +73 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/kick.mjs +68 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/line.d.mts +105 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/line.mjs +110 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linear.d.mts +68 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linear.mjs +85 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linkedin.d.mts +67 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linkedin.mjs +73 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/microsoft-entra-id.d.mts +174 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/microsoft-entra-id.mjs +140 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/naver.d.mts +92 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/naver.mjs +65 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/notion.d.mts +64 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/notion.mjs +72 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/paybin.d.mts +71 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/paybin.mjs +81 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/paypal.d.mts +129 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/paypal.mjs +140 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/polar.d.mts +74 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/polar.mjs +71 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/railway.d.mts +65 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/railway.mjs +74 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/reddit.d.mts +62 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/reddit.mjs +80 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/roblox.d.mts +70 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/roblox.mjs +57 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/salesforce.d.mts +79 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/salesforce.mjs +87 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/slack.d.mts +83 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/slack.mjs +66 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/spotify.d.mts +63 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/spotify.mjs +69 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/tiktok.d.mts +168 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/tiktok.mjs +60 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/twitch.d.mts +79 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/twitch.mjs +75 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/twitter.d.mts +126 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/twitter.mjs +85 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/vercel.d.mts +62 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/vercel.mjs +58 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/vk.d.mts +70 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/vk.mjs +81 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/wechat.d.mts +113 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/wechat.mjs +81 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/zoom.d.mts +163 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/zoom.mjs +69 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/types/context.d.mts +277 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/types/cookie.d.mts +15 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/types/helper.d.mts +10 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/types/index.d.mts +9 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/types/init-options.d.mts +1358 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/types/plugin-client.d.mts +113 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/types/plugin.d.mts +124 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/types/secret.d.mts +11 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/async.d.mts +22 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/async.mjs +32 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/db.d.mts +9 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/db.mjs +15 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/deprecate.d.mts +9 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/deprecate.mjs +16 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/error-codes.d.mts +13 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/error-codes.mjs +10 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/fetch-metadata.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/fetch-metadata.mjs +6 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/host.d.mts +147 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/host.mjs +291 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/id.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/id.mjs +7 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/ip.d.mts +54 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/ip.mjs +116 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/is-api-error.d.mts +6 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/is-api-error.mjs +8 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/json.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/json.mjs +41 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/string.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/string.mjs +6 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/url.d.mts +20 -0
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/url.mjs +31 -0
- package/template/apps/web/node_modules/@better-auth/core/package.json +193 -0
- package/template/apps/web/node_modules/@better-auth/core/src/api/index.ts +140 -0
- package/template/apps/web/node_modules/@better-auth/core/src/async_hooks/index.ts +40 -0
- package/template/apps/web/node_modules/@better-auth/core/src/async_hooks/pure.index.ts +46 -0
- package/template/apps/web/node_modules/@better-auth/core/src/context/endpoint-context.ts +50 -0
- package/template/apps/web/node_modules/@better-auth/core/src/context/global.ts +57 -0
- package/template/apps/web/node_modules/@better-auth/core/src/context/index.ts +23 -0
- package/template/apps/web/node_modules/@better-auth/core/src/context/request-state.ts +91 -0
- package/template/apps/web/node_modules/@better-auth/core/src/context/transaction.ts +136 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/factory.ts +1440 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-default-field-name.ts +59 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-default-model-name.ts +51 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-field-attributes.ts +62 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-field-name.ts +43 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-id-field.ts +150 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-model-name.ts +36 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/index.ts +567 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/types.ts +132 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/utils.ts +61 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/get-tables.ts +296 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/index.ts +43 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/plugin.ts +11 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/account.ts +47 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/rate-limit.ts +36 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/session.ts +29 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/shared.ts +7 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/user.ts +28 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/verification.ts +28 -0
- package/template/apps/web/node_modules/@better-auth/core/src/db/type.ts +333 -0
- package/template/apps/web/node_modules/@better-auth/core/src/env/color-depth.ts +172 -0
- package/template/apps/web/node_modules/@better-auth/core/src/env/env-impl.ts +124 -0
- package/template/apps/web/node_modules/@better-auth/core/src/env/index.ts +23 -0
- package/template/apps/web/node_modules/@better-auth/core/src/env/logger.ts +145 -0
- package/template/apps/web/node_modules/@better-auth/core/src/error/codes.ts +71 -0
- package/template/apps/web/node_modules/@better-auth/core/src/error/index.ts +35 -0
- package/template/apps/web/node_modules/@better-auth/core/src/index.ts +1 -0
- package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/api.ts +17 -0
- package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/attributes.ts +22 -0
- package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/index.ts +2 -0
- package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/noop.ts +74 -0
- package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/pure.index.ts +31 -0
- package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/tracer.ts +95 -0
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/client-credentials-token.ts +126 -0
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/create-authorization-url.ts +89 -0
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/index.ts +33 -0
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/oauth-provider.ts +222 -0
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/refresh-access-token.ts +157 -0
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/utils.ts +51 -0
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/validate-authorization-code.ts +180 -0
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/verify.ts +221 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/apple.ts +231 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/atlassian.ts +133 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/cognito.ts +281 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/discord.ts +170 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/dropbox.ts +112 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/facebook.ts +215 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/figma.ts +118 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/github.ts +184 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/gitlab.ts +155 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/google.ts +204 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/huggingface.ts +119 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/index.ts +132 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/kakao.ts +179 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/kick.ts +109 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/line.ts +169 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/linear.ts +121 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/linkedin.ts +110 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/microsoft-entra-id.ts +352 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/naver.ts +113 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/notion.ts +108 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/paybin.ts +118 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/paypal.ts +263 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/polar.ts +111 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/railway.ts +100 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/reddit.ts +122 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/roblox.ts +112 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/salesforce.ts +159 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/slack.ts +112 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/spotify.ts +94 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/tiktok.ts +211 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/twitch.ts +112 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/twitter.ts +199 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/vercel.ts +87 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/vk.ts +125 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/wechat.ts +213 -0
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/zoom.ts +230 -0
- package/template/apps/web/node_modules/@better-auth/core/src/types/context.ts +415 -0
- package/template/apps/web/node_modules/@better-auth/core/src/types/cookie.ts +10 -0
- package/template/apps/web/node_modules/@better-auth/core/src/types/helper.ts +27 -0
- package/template/apps/web/node_modules/@better-auth/core/src/types/index.ts +40 -0
- package/template/apps/web/node_modules/@better-auth/core/src/types/init-options.ts +1610 -0
- package/template/apps/web/node_modules/@better-auth/core/src/types/plugin-client.ts +129 -0
- package/template/apps/web/node_modules/@better-auth/core/src/types/plugin.ts +163 -0
- package/template/apps/web/node_modules/@better-auth/core/src/types/secret.ts +8 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/async.ts +53 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/db.ts +20 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/deprecate.ts +21 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/error-codes.ts +68 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/fetch-metadata.ts +3 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/host.ts +401 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/id.ts +5 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/ip.ts +211 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/is-api-error.ts +10 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/json.ts +56 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/string.ts +3 -0
- package/template/apps/web/node_modules/@better-auth/core/src/utils/url.ts +43 -0
- package/template/apps/web/node_modules/@better-auth/drizzle-adapter/LICENSE.md +20 -0
- package/template/apps/web/node_modules/@better-auth/drizzle-adapter/README.md +17 -0
- package/template/apps/web/node_modules/@better-auth/drizzle-adapter/dist/index.d.mts +47 -0
- package/template/apps/web/node_modules/@better-auth/drizzle-adapter/dist/index.mjs +458 -0
- package/template/apps/web/node_modules/@better-auth/drizzle-adapter/package.json +62 -0
- package/template/apps/web/node_modules/@better-auth/utils/README.md +384 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base32.cjs +104 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base32.d.cts +44 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base32.d.mts +44 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base32.d.ts +44 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base32.mjs +101 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base64.cjs +80 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base64.d.cts +16 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base64.d.mts +16 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base64.d.ts +16 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/base64.mjs +77 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/binary.cjs +16 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/binary.d.cts +8 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/binary.d.mts +8 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/binary.d.ts +8 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/binary.mjs +14 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.cjs +90 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.d.cts +19 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.d.mts +19 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.d.ts +19 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.mjs +88 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hash.cjs +31 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hash.d.cts +7 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hash.d.mts +7 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hash.d.ts +7 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hash.mjs +29 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hex.cjs +40 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hex.d.cts +8 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hex.d.mts +8 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hex.d.ts +8 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hex.mjs +38 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.cjs +58 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.d.cts +9 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.d.mts +9 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.d.ts +9 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.mjs +56 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/index.cjs +10 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/index.d.cts +3 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/index.d.mts +3 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/index.d.ts +3 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/index.mjs +8 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/otp.cjs +90 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/otp.d.cts +13 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/otp.d.mts +13 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/otp.d.ts +13 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/otp.mjs +88 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.cjs +36 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.d.cts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.d.ts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.mjs +33 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.cjs +47 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.d.cts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.d.ts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.mjs +44 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/random.cjs +55 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/random.d.cts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/random.d.mts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/random.d.ts +4 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/random.mjs +53 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.cjs +76 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.d.cts +16 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.d.mts +16 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.d.ts +16 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.mjs +74 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/shared/utils.ecd028f7.d.cts +22 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/shared/utils.ecd028f7.d.mts +22 -0
- package/template/apps/web/node_modules/@better-auth/utils/dist/shared/utils.ecd028f7.d.ts +22 -0
- package/template/apps/web/node_modules/@better-auth/utils/package.json +95 -0
- package/template/apps/web/node_modules/better-call/LICENSE +21 -0
- package/template/apps/web/node_modules/better-call/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.cjs +181 -0
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.d.cts +16 -0
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.d.mts +16 -0
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.mjs +178 -0
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/client.cjs +23 -0
- package/template/apps/web/node_modules/better-call/dist/client.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/client.d.cts +53 -0
- package/template/apps/web/node_modules/better-call/dist/client.d.mts +53 -0
- package/template/apps/web/node_modules/better-call/dist/client.mjs +14 -0
- package/template/apps/web/node_modules/better-call/dist/client.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/context.cjs +103 -0
- package/template/apps/web/node_modules/better-call/dist/context.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/context.d.cts +341 -0
- package/template/apps/web/node_modules/better-call/dist/context.d.mts +341 -0
- package/template/apps/web/node_modules/better-call/dist/context.mjs +103 -0
- package/template/apps/web/node_modules/better-call/dist/context.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/cookies.cjs +87 -0
- package/template/apps/web/node_modules/better-call/dist/cookies.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/cookies.d.cts +103 -0
- package/template/apps/web/node_modules/better-call/dist/cookies.d.mts +103 -0
- package/template/apps/web/node_modules/better-call/dist/cookies.mjs +84 -0
- package/template/apps/web/node_modules/better-call/dist/cookies.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/crypto.cjs +39 -0
- package/template/apps/web/node_modules/better-call/dist/crypto.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/crypto.mjs +36 -0
- package/template/apps/web/node_modules/better-call/dist/crypto.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/endpoint.cjs +70 -0
- package/template/apps/web/node_modules/better-call/dist/endpoint.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/endpoint.d.cts +475 -0
- package/template/apps/web/node_modules/better-call/dist/endpoint.d.mts +475 -0
- package/template/apps/web/node_modules/better-call/dist/endpoint.mjs +70 -0
- package/template/apps/web/node_modules/better-call/dist/endpoint.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/error.cjs +141 -0
- package/template/apps/web/node_modules/better-call/dist/error.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/error.d.cts +103 -0
- package/template/apps/web/node_modules/better-call/dist/error.d.mts +103 -0
- package/template/apps/web/node_modules/better-call/dist/error.mjs +133 -0
- package/template/apps/web/node_modules/better-call/dist/error.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/helper.d.cts +12 -0
- package/template/apps/web/node_modules/better-call/dist/helper.d.mts +12 -0
- package/template/apps/web/node_modules/better-call/dist/index.cjs +28 -0
- package/template/apps/web/node_modules/better-call/dist/index.d.cts +11 -0
- package/template/apps/web/node_modules/better-call/dist/index.d.mts +11 -0
- package/template/apps/web/node_modules/better-call/dist/index.mjs +10 -0
- package/template/apps/web/node_modules/better-call/dist/middleware.cjs +52 -0
- package/template/apps/web/node_modules/better-call/dist/middleware.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/middleware.d.cts +123 -0
- package/template/apps/web/node_modules/better-call/dist/middleware.d.mts +123 -0
- package/template/apps/web/node_modules/better-call/dist/middleware.mjs +52 -0
- package/template/apps/web/node_modules/better-call/dist/middleware.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/node.cjs +18 -0
- package/template/apps/web/node_modules/better-call/dist/node.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/node.d.cts +9 -0
- package/template/apps/web/node_modules/better-call/dist/node.d.mts +9 -0
- package/template/apps/web/node_modules/better-call/dist/node.mjs +15 -0
- package/template/apps/web/node_modules/better-call/dist/node.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/openapi.cjs +191 -0
- package/template/apps/web/node_modules/better-call/dist/openapi.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/openapi.d.cts +113 -0
- package/template/apps/web/node_modules/better-call/dist/openapi.d.mts +113 -0
- package/template/apps/web/node_modules/better-call/dist/openapi.mjs +189 -0
- package/template/apps/web/node_modules/better-call/dist/openapi.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/router.cjs +118 -0
- package/template/apps/web/node_modules/better-call/dist/router.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/router.d.cts +103 -0
- package/template/apps/web/node_modules/better-call/dist/router.d.mts +103 -0
- package/template/apps/web/node_modules/better-call/dist/router.mjs +117 -0
- package/template/apps/web/node_modules/better-call/dist/router.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/standard-schema.d.cts +59 -0
- package/template/apps/web/node_modules/better-call/dist/standard-schema.d.mts +59 -0
- package/template/apps/web/node_modules/better-call/dist/to-response.cjs +153 -0
- package/template/apps/web/node_modules/better-call/dist/to-response.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/to-response.d.cts +12 -0
- package/template/apps/web/node_modules/better-call/dist/to-response.d.mts +12 -0
- package/template/apps/web/node_modules/better-call/dist/to-response.mjs +153 -0
- package/template/apps/web/node_modules/better-call/dist/to-response.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/utils.cjs +86 -0
- package/template/apps/web/node_modules/better-call/dist/utils.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/utils.mjs +82 -0
- package/template/apps/web/node_modules/better-call/dist/utils.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/validator.cjs +58 -0
- package/template/apps/web/node_modules/better-call/dist/validator.cjs.map +1 -0
- package/template/apps/web/node_modules/better-call/dist/validator.mjs +57 -0
- package/template/apps/web/node_modules/better-call/dist/validator.mjs.map +1 -0
- package/template/apps/web/node_modules/better-call/package.json +96 -0
- package/template/apps/web/node_modules/set-cookie-parser/LICENSE +21 -0
- package/template/apps/web/node_modules/set-cookie-parser/README.md +169 -0
- package/template/apps/web/node_modules/set-cookie-parser/dist/.eslintrc.cjs +16 -0
- package/template/apps/web/node_modules/set-cookie-parser/dist/set-cookie.cjs +260 -0
- package/template/apps/web/node_modules/set-cookie-parser/lib/set-cookie.d.ts +119 -0
- package/template/apps/web/node_modules/set-cookie-parser/lib/set-cookie.js +265 -0
- package/template/apps/web/node_modules/set-cookie-parser/package.json +61 -0
- package/template/apps/web/package.json +44 -0
- package/template/apps/web/public/favicon.ico +0 -0
- package/template/apps/web/public/manifest.json +25 -0
- package/template/apps/web/public/robots.txt +3 -0
- package/template/apps/web/src/components/app-sidebar.tsx +139 -0
- package/template/apps/web/src/components/login-form.tsx +111 -0
- package/template/apps/web/src/components/search-form.tsx +27 -0
- package/template/apps/web/src/components/signup-form.tsx +137 -0
- package/template/apps/web/src/components/version-switcher.tsx +64 -0
- package/template/apps/web/src/hooks/use-mobile.ts +19 -0
- package/template/apps/web/src/lib/auth-client.ts +3 -0
- package/template/apps/web/src/lib/auth-utils.ts +15 -0
- package/template/apps/web/src/lib/orpc.ts +32 -0
- package/template/apps/web/src/routeTree.gen.ts +282 -0
- package/template/apps/web/src/router.tsx +20 -0
- package/template/apps/web/src/routes/__root.tsx +53 -0
- package/template/apps/web/src/routes/api/auth/$.ts +15 -0
- package/template/apps/web/src/routes/api/rpc.$.ts +34 -0
- package/template/apps/web/src/routes/client-orpc-auth.tsx +62 -0
- package/template/apps/web/src/routes/client-orpc.tsx +43 -0
- package/template/apps/web/src/routes/dashboard.tsx +59 -0
- package/template/apps/web/src/routes/index.tsx +57 -0
- package/template/apps/web/src/routes/isr.tsx +33 -0
- package/template/apps/web/src/routes/login.tsx +16 -0
- package/template/apps/web/src/routes/signup.tsx +16 -0
- package/template/apps/web/src/routes/ssr-orpc-auth.tsx +53 -0
- package/template/apps/web/src/routes/ssr-orpc.tsx +36 -0
- package/template/apps/web/tsconfig.json +29 -0
- package/template/apps/web/vite.config.ts +19 -0
- package/template/docker-compose.yml +16 -0
- package/template/package.json +35 -0
- package/template/packages/auth/eslint.config.ts +3 -0
- package/template/packages/auth/package.json +24 -0
- package/template/packages/auth/src/lib/auth.ts +13 -0
- package/template/packages/auth/tsconfig.json +17 -0
- package/template/packages/auth/tsconfig.lint.json +14 -0
- package/template/packages/db/eslint.config.ts +3 -0
- package/template/packages/db/package.json +27 -0
- package/template/packages/db/src/auth-schema.ts +93 -0
- package/template/packages/db/src/index.ts +7 -0
- package/template/packages/db/src/planets-schema.ts +13 -0
- package/template/packages/db/src/schema.ts +2 -0
- package/template/packages/db/tsconfig.json +17 -0
- package/template/packages/db/tsconfig.lint.json +14 -0
- package/template/packages/orpc/eslint.config.ts +3 -0
- package/template/packages/orpc/package.json +21 -0
- package/template/packages/orpc/src/lib/router.ts +52 -0
- package/template/packages/orpc/tsconfig.json +17 -0
- package/template/packages/orpc/tsconfig.lint.json +14 -0
- package/template/packages/ui/components.json +23 -0
- package/template/packages/ui/eslint.config.ts +3 -0
- package/template/packages/ui/package.json +48 -0
- package/template/packages/ui/src/components/.gitkeep +0 -0
- package/template/packages/ui/src/components/accordion.tsx +72 -0
- package/template/packages/ui/src/components/alert-dialog.tsx +187 -0
- package/template/packages/ui/src/components/alert.tsx +77 -0
- package/template/packages/ui/src/components/aspect-ratio.tsx +22 -0
- package/template/packages/ui/src/components/avatar.tsx +107 -0
- package/template/packages/ui/src/components/badge.tsx +53 -0
- package/template/packages/ui/src/components/breadcrumb.tsx +125 -0
- package/template/packages/ui/src/components/button-group.tsx +88 -0
- package/template/packages/ui/src/components/button.tsx +59 -0
- package/template/packages/ui/src/components/calendar.tsx +229 -0
- package/template/packages/ui/src/components/card.tsx +103 -0
- package/template/packages/ui/src/components/carousel.tsx +240 -0
- package/template/packages/ui/src/components/chart.tsx +371 -0
- package/template/packages/ui/src/components/checkbox.tsx +29 -0
- package/template/packages/ui/src/components/collapsible.tsx +19 -0
- package/template/packages/ui/src/components/combobox.tsx +295 -0
- package/template/packages/ui/src/components/command.tsx +196 -0
- package/template/packages/ui/src/components/context-menu.tsx +271 -0
- package/template/packages/ui/src/components/dialog.tsx +158 -0
- package/template/packages/ui/src/components/direction.tsx +4 -0
- package/template/packages/ui/src/components/drawer.tsx +134 -0
- package/template/packages/ui/src/components/dropdown-menu.tsx +266 -0
- package/template/packages/ui/src/components/empty.tsx +105 -0
- package/template/packages/ui/src/components/field.tsx +237 -0
- package/template/packages/ui/src/components/hover-card.tsx +51 -0
- package/template/packages/ui/src/components/input-group.tsx +159 -0
- package/template/packages/ui/src/components/input-otp.tsx +85 -0
- package/template/packages/ui/src/components/input.tsx +20 -0
- package/template/packages/ui/src/components/item.tsx +202 -0
- package/template/packages/ui/src/components/kbd.tsx +26 -0
- package/template/packages/ui/src/components/label.tsx +20 -0
- package/template/packages/ui/src/components/menubar.tsx +280 -0
- package/template/packages/ui/src/components/native-select.tsx +61 -0
- package/template/packages/ui/src/components/navigation-menu.tsx +168 -0
- package/template/packages/ui/src/components/pagination.tsx +130 -0
- package/template/packages/ui/src/components/popover.tsx +88 -0
- package/template/packages/ui/src/components/progress.tsx +83 -0
- package/template/packages/ui/src/components/radio-group.tsx +36 -0
- package/template/packages/ui/src/components/resizable.tsx +50 -0
- package/template/packages/ui/src/components/scroll-area.tsx +53 -0
- package/template/packages/ui/src/components/select.tsx +201 -0
- package/template/packages/ui/src/components/separator.tsx +23 -0
- package/template/packages/ui/src/components/sheet.tsx +138 -0
- package/template/packages/ui/src/components/sidebar.tsx +726 -0
- package/template/packages/ui/src/components/skeleton.tsx +13 -0
- package/template/packages/ui/src/components/slider.tsx +52 -0
- package/template/packages/ui/src/components/sonner.tsx +50 -0
- package/template/packages/ui/src/components/spinner.tsx +10 -0
- package/template/packages/ui/src/components/switch.tsx +30 -0
- package/template/packages/ui/src/components/table.tsx +116 -0
- package/template/packages/ui/src/components/tabs.tsx +81 -0
- package/template/packages/ui/src/components/textarea.tsx +18 -0
- package/template/packages/ui/src/components/toggle-group.tsx +87 -0
- package/template/packages/ui/src/components/toggle.tsx +46 -0
- package/template/packages/ui/src/components/tooltip.tsx +64 -0
- package/template/packages/ui/src/hooks/.gitkeep +0 -0
- package/template/packages/ui/src/hooks/use-mobile.ts +19 -0
- package/template/packages/ui/src/lib/.gitkeep +0 -0
- package/template/packages/ui/src/lib/utils.ts +7 -0
- package/template/packages/ui/src/styles/globals.css +130 -0
- package/template/packages/ui/tsconfig.json +17 -0
- package/template/packages/ui/tsconfig.lint.json +14 -0
- package/template/tsconfig.json +9 -0
- package/template/turbo.json +24 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { AwaitableFunction } from "../types/helper.mjs";
|
|
2
|
+
import { OAuth2Tokens, ProviderOptions } from "./oauth-provider.mjs";
|
|
3
|
+
import * as jose from "jose";
|
|
4
|
+
|
|
5
|
+
//#region src/oauth2/validate-authorization-code.d.ts
|
|
6
|
+
declare function authorizationCodeRequest({
|
|
7
|
+
code,
|
|
8
|
+
codeVerifier,
|
|
9
|
+
redirectURI,
|
|
10
|
+
options,
|
|
11
|
+
authentication,
|
|
12
|
+
deviceId,
|
|
13
|
+
headers,
|
|
14
|
+
additionalParams,
|
|
15
|
+
resource
|
|
16
|
+
}: {
|
|
17
|
+
code: string;
|
|
18
|
+
redirectURI: string;
|
|
19
|
+
options: AwaitableFunction<Partial<ProviderOptions>>;
|
|
20
|
+
codeVerifier?: string | undefined;
|
|
21
|
+
deviceId?: string | undefined;
|
|
22
|
+
authentication?: ("basic" | "post") | undefined;
|
|
23
|
+
headers?: Record<string, string> | undefined;
|
|
24
|
+
additionalParams?: Record<string, string> | undefined;
|
|
25
|
+
resource?: (string | string[]) | undefined;
|
|
26
|
+
}): Promise<{
|
|
27
|
+
body: URLSearchParams;
|
|
28
|
+
headers: Record<string, any>;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated use async'd authorizationCodeRequest instead
|
|
32
|
+
*/
|
|
33
|
+
declare function createAuthorizationCodeRequest({
|
|
34
|
+
code,
|
|
35
|
+
codeVerifier,
|
|
36
|
+
redirectURI,
|
|
37
|
+
options,
|
|
38
|
+
authentication,
|
|
39
|
+
deviceId,
|
|
40
|
+
headers,
|
|
41
|
+
additionalParams,
|
|
42
|
+
resource
|
|
43
|
+
}: {
|
|
44
|
+
code: string;
|
|
45
|
+
redirectURI: string;
|
|
46
|
+
options: Partial<ProviderOptions>;
|
|
47
|
+
codeVerifier?: string | undefined;
|
|
48
|
+
deviceId?: string | undefined;
|
|
49
|
+
authentication?: ("basic" | "post") | undefined;
|
|
50
|
+
headers?: Record<string, string> | undefined;
|
|
51
|
+
additionalParams?: Record<string, string> | undefined;
|
|
52
|
+
resource?: (string | string[]) | undefined;
|
|
53
|
+
}): {
|
|
54
|
+
body: URLSearchParams;
|
|
55
|
+
headers: Record<string, any>;
|
|
56
|
+
};
|
|
57
|
+
declare function validateAuthorizationCode({
|
|
58
|
+
code,
|
|
59
|
+
codeVerifier,
|
|
60
|
+
redirectURI,
|
|
61
|
+
options,
|
|
62
|
+
tokenEndpoint,
|
|
63
|
+
authentication,
|
|
64
|
+
deviceId,
|
|
65
|
+
headers,
|
|
66
|
+
additionalParams,
|
|
67
|
+
resource
|
|
68
|
+
}: {
|
|
69
|
+
code: string;
|
|
70
|
+
redirectURI: string;
|
|
71
|
+
options: AwaitableFunction<Partial<ProviderOptions>>;
|
|
72
|
+
codeVerifier?: string | undefined;
|
|
73
|
+
deviceId?: string | undefined;
|
|
74
|
+
tokenEndpoint: string;
|
|
75
|
+
authentication?: ("basic" | "post") | undefined;
|
|
76
|
+
headers?: Record<string, string> | undefined;
|
|
77
|
+
additionalParams?: Record<string, string> | undefined;
|
|
78
|
+
resource?: (string | string[]) | undefined;
|
|
79
|
+
}): Promise<OAuth2Tokens>;
|
|
80
|
+
declare function validateToken(token: string, jwksEndpoint: string, options?: {
|
|
81
|
+
audience?: string | string[];
|
|
82
|
+
issuer?: string | string[];
|
|
83
|
+
}): Promise<jose.JWTVerifyResult<jose.JWTPayload> & jose.ResolvedKey>;
|
|
84
|
+
//#endregion
|
|
85
|
+
export { authorizationCodeRequest, createAuthorizationCodeRequest, validateAuthorizationCode, validateToken };
|
package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/validate-authorization-code.mjs
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { getOAuth2Tokens } from "./utils.mjs";
|
|
2
|
+
import { base64 } from "@better-auth/utils/base64";
|
|
3
|
+
import { betterFetch } from "@better-fetch/fetch";
|
|
4
|
+
import { createRemoteJWKSet, jwtVerify } from "jose";
|
|
5
|
+
//#region src/oauth2/validate-authorization-code.ts
|
|
6
|
+
async function authorizationCodeRequest({ code, codeVerifier, redirectURI, options, authentication, deviceId, headers, additionalParams = {}, resource }) {
|
|
7
|
+
options = typeof options === "function" ? await options() : options;
|
|
8
|
+
return createAuthorizationCodeRequest({
|
|
9
|
+
code,
|
|
10
|
+
codeVerifier,
|
|
11
|
+
redirectURI,
|
|
12
|
+
options,
|
|
13
|
+
authentication,
|
|
14
|
+
deviceId,
|
|
15
|
+
headers,
|
|
16
|
+
additionalParams,
|
|
17
|
+
resource
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated use async'd authorizationCodeRequest instead
|
|
22
|
+
*/
|
|
23
|
+
function createAuthorizationCodeRequest({ code, codeVerifier, redirectURI, options, authentication, deviceId, headers, additionalParams = {}, resource }) {
|
|
24
|
+
const body = new URLSearchParams();
|
|
25
|
+
const requestHeaders = {
|
|
26
|
+
"content-type": "application/x-www-form-urlencoded",
|
|
27
|
+
accept: "application/json",
|
|
28
|
+
...headers
|
|
29
|
+
};
|
|
30
|
+
body.set("grant_type", "authorization_code");
|
|
31
|
+
body.set("code", code);
|
|
32
|
+
codeVerifier && body.set("code_verifier", codeVerifier);
|
|
33
|
+
options.clientKey && body.set("client_key", options.clientKey);
|
|
34
|
+
deviceId && body.set("device_id", deviceId);
|
|
35
|
+
body.set("redirect_uri", options.redirectURI || redirectURI);
|
|
36
|
+
if (resource) if (typeof resource === "string") body.append("resource", resource);
|
|
37
|
+
else for (const _resource of resource) body.append("resource", _resource);
|
|
38
|
+
if (authentication === "basic") {
|
|
39
|
+
const primaryClientId = Array.isArray(options.clientId) ? options.clientId[0] : options.clientId;
|
|
40
|
+
requestHeaders["authorization"] = `Basic ${base64.encode(`${primaryClientId}:${options.clientSecret ?? ""}`)}`;
|
|
41
|
+
} else {
|
|
42
|
+
const primaryClientId = Array.isArray(options.clientId) ? options.clientId[0] : options.clientId;
|
|
43
|
+
body.set("client_id", primaryClientId);
|
|
44
|
+
if (options.clientSecret) body.set("client_secret", options.clientSecret);
|
|
45
|
+
}
|
|
46
|
+
for (const [key, value] of Object.entries(additionalParams)) if (!body.has(key)) body.append(key, value);
|
|
47
|
+
return {
|
|
48
|
+
body,
|
|
49
|
+
headers: requestHeaders
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
async function validateAuthorizationCode({ code, codeVerifier, redirectURI, options, tokenEndpoint, authentication, deviceId, headers, additionalParams = {}, resource }) {
|
|
53
|
+
const { body, headers: requestHeaders } = await authorizationCodeRequest({
|
|
54
|
+
code,
|
|
55
|
+
codeVerifier,
|
|
56
|
+
redirectURI,
|
|
57
|
+
options,
|
|
58
|
+
authentication,
|
|
59
|
+
deviceId,
|
|
60
|
+
headers,
|
|
61
|
+
additionalParams,
|
|
62
|
+
resource
|
|
63
|
+
});
|
|
64
|
+
const { data, error } = await betterFetch(tokenEndpoint, {
|
|
65
|
+
method: "POST",
|
|
66
|
+
body,
|
|
67
|
+
headers: requestHeaders
|
|
68
|
+
});
|
|
69
|
+
if (error) throw error;
|
|
70
|
+
return getOAuth2Tokens(data);
|
|
71
|
+
}
|
|
72
|
+
async function validateToken(token, jwksEndpoint, options) {
|
|
73
|
+
return await jwtVerify(token, createRemoteJWKSet(new URL(jwksEndpoint)), {
|
|
74
|
+
audience: options?.audience,
|
|
75
|
+
issuer: options?.issuer
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
export { authorizationCodeRequest, createAuthorizationCodeRequest, validateAuthorizationCode, validateToken };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { JSONWebKeySet, JWTPayload, JWTVerifyOptions } from "jose";
|
|
2
|
+
|
|
3
|
+
//#region src/oauth2/verify.d.ts
|
|
4
|
+
interface VerifyAccessTokenRemote {
|
|
5
|
+
/** Full url of the introspect endpoint. Should end with `/oauth2/introspect` */
|
|
6
|
+
introspectUrl: string;
|
|
7
|
+
/** Client Secret */
|
|
8
|
+
clientId: string;
|
|
9
|
+
/** Client Secret */
|
|
10
|
+
clientSecret: string;
|
|
11
|
+
/**
|
|
12
|
+
* Forces remote verification of a token.
|
|
13
|
+
* This ensures attached session (if applicable)
|
|
14
|
+
* is also still active.
|
|
15
|
+
*/
|
|
16
|
+
force?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Performs local verification of an access token for your APIs.
|
|
20
|
+
*
|
|
21
|
+
* Can also be configured for remote verification.
|
|
22
|
+
*/
|
|
23
|
+
declare function verifyJwsAccessToken(token: string, opts: {
|
|
24
|
+
/** Jwks url or promise of a Jwks */jwksFetch: string | (() => Promise<JSONWebKeySet | undefined>); /** Verify options */
|
|
25
|
+
verifyOptions: JWTVerifyOptions & Required<Pick<JWTVerifyOptions, "audience" | "issuer">>;
|
|
26
|
+
}): Promise<JWTPayload>;
|
|
27
|
+
declare function getJwks(token: string, opts: {
|
|
28
|
+
/** Jwks url or promise of a Jwks */jwksFetch: string | (() => Promise<JSONWebKeySet | undefined>);
|
|
29
|
+
}): Promise<JSONWebKeySet>;
|
|
30
|
+
/**
|
|
31
|
+
* Performs local verification of an access token for your API.
|
|
32
|
+
*
|
|
33
|
+
* Can also be configured for remote verification.
|
|
34
|
+
*/
|
|
35
|
+
declare function verifyAccessToken(token: string, opts: {
|
|
36
|
+
/** Verify options */verifyOptions: JWTVerifyOptions & Required<Pick<JWTVerifyOptions, "audience" | "issuer">>; /** Scopes to additionally verify. Token must include all but not exact. */
|
|
37
|
+
scopes?: string[]; /** Required to verify access token locally */
|
|
38
|
+
jwksUrl?: string; /** If provided, can verify a token remotely */
|
|
39
|
+
remoteVerify?: VerifyAccessTokenRemote;
|
|
40
|
+
}): Promise<JWTPayload>;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { getJwks, verifyAccessToken, verifyJwsAccessToken };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { logger } from "../env/logger.mjs";
|
|
2
|
+
import { APIError } from "better-call";
|
|
3
|
+
import { betterFetch } from "@better-fetch/fetch";
|
|
4
|
+
import { UnsecuredJWT, createLocalJWKSet, decodeProtectedHeader, jwtVerify } from "jose";
|
|
5
|
+
//#region src/oauth2/verify.ts
|
|
6
|
+
/** Last fetched jwks used locally in getJwks @internal */
|
|
7
|
+
let jwks;
|
|
8
|
+
/**
|
|
9
|
+
* Performs local verification of an access token for your APIs.
|
|
10
|
+
*
|
|
11
|
+
* Can also be configured for remote verification.
|
|
12
|
+
*/
|
|
13
|
+
async function verifyJwsAccessToken(token, opts) {
|
|
14
|
+
try {
|
|
15
|
+
const jwt = await jwtVerify(token, createLocalJWKSet(await getJwks(token, opts)), opts.verifyOptions);
|
|
16
|
+
if (jwt.payload.azp) jwt.payload.client_id = jwt.payload.azp;
|
|
17
|
+
return jwt.payload;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
if (error instanceof Error) throw error;
|
|
20
|
+
throw new Error(error);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async function getJwks(token, opts) {
|
|
24
|
+
let jwtHeaders;
|
|
25
|
+
try {
|
|
26
|
+
jwtHeaders = decodeProtectedHeader(token);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
if (error instanceof Error) throw error;
|
|
29
|
+
throw new Error(error);
|
|
30
|
+
}
|
|
31
|
+
if (!jwtHeaders.kid) throw new Error("Missing jwt kid");
|
|
32
|
+
if (!jwks || !jwks.keys.find((jwk) => jwk.kid === jwtHeaders.kid)) {
|
|
33
|
+
jwks = typeof opts.jwksFetch === "string" ? await betterFetch(opts.jwksFetch, { headers: { Accept: "application/json" } }).then(async (res) => {
|
|
34
|
+
if (res.error) throw new Error(`Jwks failed: ${res.error.message ?? res.error.statusText}`);
|
|
35
|
+
return res.data;
|
|
36
|
+
}) : await opts.jwksFetch();
|
|
37
|
+
if (!jwks) throw new Error("No jwks found");
|
|
38
|
+
}
|
|
39
|
+
return jwks;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Performs local verification of an access token for your API.
|
|
43
|
+
*
|
|
44
|
+
* Can also be configured for remote verification.
|
|
45
|
+
*/
|
|
46
|
+
async function verifyAccessToken(token, opts) {
|
|
47
|
+
let payload;
|
|
48
|
+
if (opts.jwksUrl && !opts?.remoteVerify?.force) try {
|
|
49
|
+
payload = await verifyJwsAccessToken(token, {
|
|
50
|
+
jwksFetch: opts.jwksUrl,
|
|
51
|
+
verifyOptions: opts.verifyOptions
|
|
52
|
+
});
|
|
53
|
+
} catch (error) {
|
|
54
|
+
if (error instanceof Error) if (error.name === "TypeError" || error.name === "JWSInvalid") {} else if (error.name === "JWTExpired") throw new APIError("UNAUTHORIZED", { message: "token expired" });
|
|
55
|
+
else if (error.name === "JWTInvalid") throw new APIError("UNAUTHORIZED", { message: "token invalid" });
|
|
56
|
+
else throw error;
|
|
57
|
+
else throw new Error(error);
|
|
58
|
+
}
|
|
59
|
+
if (opts?.remoteVerify) {
|
|
60
|
+
const { data: introspect, error: introspectError } = await betterFetch(opts.remoteVerify.introspectUrl, {
|
|
61
|
+
method: "POST",
|
|
62
|
+
headers: {
|
|
63
|
+
Accept: "application/json",
|
|
64
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
65
|
+
},
|
|
66
|
+
body: new URLSearchParams({
|
|
67
|
+
client_id: opts.remoteVerify.clientId,
|
|
68
|
+
client_secret: opts.remoteVerify.clientSecret,
|
|
69
|
+
token,
|
|
70
|
+
token_type_hint: "access_token"
|
|
71
|
+
}).toString()
|
|
72
|
+
});
|
|
73
|
+
if (introspectError) logger.error(`Introspection failed: ${introspectError.message ?? introspectError.statusText}`);
|
|
74
|
+
if (!introspect) throw new APIError("INTERNAL_SERVER_ERROR", { message: "introspection failed" });
|
|
75
|
+
if (!introspect.active) throw new APIError("UNAUTHORIZED", { message: "token inactive" });
|
|
76
|
+
try {
|
|
77
|
+
const unsecuredJwt = new UnsecuredJWT(introspect).encode();
|
|
78
|
+
const { audience: _audience, ...verifyOptions } = opts.verifyOptions;
|
|
79
|
+
payload = (introspect.aud ? UnsecuredJWT.decode(unsecuredJwt, opts.verifyOptions) : UnsecuredJWT.decode(unsecuredJwt, verifyOptions)).payload;
|
|
80
|
+
} catch (error) {
|
|
81
|
+
throw new Error(error);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (!payload) throw new APIError("UNAUTHORIZED", { message: `no token payload` });
|
|
85
|
+
if (opts.scopes) {
|
|
86
|
+
const validScopes = new Set(payload.scope?.split(" "));
|
|
87
|
+
for (const sc of opts.scopes) if (!validScopes.has(sc)) throw new APIError("FORBIDDEN", { message: `invalid scope ${sc}` });
|
|
88
|
+
}
|
|
89
|
+
return payload;
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { getJwks, verifyAccessToken, verifyJwsAccessToken };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { OAuth2Tokens, ProviderOptions } from "../oauth2/oauth-provider.mjs";
|
|
2
|
+
//#region src/social-providers/apple.d.ts
|
|
3
|
+
interface AppleProfile {
|
|
4
|
+
/**
|
|
5
|
+
* The subject registered claim identifies the principal that’s the subject
|
|
6
|
+
* of the identity token. Because this token is for your app, the value is
|
|
7
|
+
* the unique identifier for the user.
|
|
8
|
+
*/
|
|
9
|
+
sub: string;
|
|
10
|
+
/**
|
|
11
|
+
* A String value representing the user's email address.
|
|
12
|
+
* The email address is either the user's real email address or the proxy
|
|
13
|
+
* address, depending on their status private email relay service.
|
|
14
|
+
*/
|
|
15
|
+
email: string;
|
|
16
|
+
/**
|
|
17
|
+
* A string or Boolean value that indicates whether the service verifies
|
|
18
|
+
* the email. The value can either be a string ("true" or "false") or a
|
|
19
|
+
* Boolean (true or false). The system may not verify email addresses for
|
|
20
|
+
* Sign in with Apple at Work & School users, and this claim is "false" or
|
|
21
|
+
* false for those users.
|
|
22
|
+
*/
|
|
23
|
+
email_verified: true | "true";
|
|
24
|
+
/**
|
|
25
|
+
* A string or Boolean value that indicates whether the email that the user
|
|
26
|
+
* shares is the proxy address. The value can either be a string ("true" or
|
|
27
|
+
* "false") or a Boolean (true or false).
|
|
28
|
+
*/
|
|
29
|
+
is_private_email: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* An Integer value that indicates whether the user appears to be a real
|
|
32
|
+
* person. Use the value of this claim to mitigate fraud. The possible
|
|
33
|
+
* values are: 0 (or Unsupported), 1 (or Unknown), 2 (or LikelyReal). For
|
|
34
|
+
* more information, see ASUserDetectionStatus. This claim is present only
|
|
35
|
+
* in iOS 14 and later, macOS 11 and later, watchOS 7 and later, tvOS 14
|
|
36
|
+
* and later. The claim isn’t present or supported for web-based apps.
|
|
37
|
+
*/
|
|
38
|
+
real_user_status: number;
|
|
39
|
+
/**
|
|
40
|
+
* The user’s full name in the format provided during the authorization
|
|
41
|
+
* process.
|
|
42
|
+
*/
|
|
43
|
+
name: string;
|
|
44
|
+
/**
|
|
45
|
+
* The URL to the user's profile picture.
|
|
46
|
+
*/
|
|
47
|
+
picture: string;
|
|
48
|
+
user?: AppleNonConformUser | undefined;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* This is the shape of the `user` query parameter that Apple sends the first
|
|
52
|
+
* time the user consents to the app.
|
|
53
|
+
* @see https://developer.apple.com/documentation/signinwithapplerestapi/request-an-authorization-to-the-sign-in-with-apple-server./
|
|
54
|
+
*/
|
|
55
|
+
interface AppleNonConformUser {
|
|
56
|
+
name: {
|
|
57
|
+
firstName: string;
|
|
58
|
+
lastName: string;
|
|
59
|
+
};
|
|
60
|
+
email: string;
|
|
61
|
+
}
|
|
62
|
+
interface AppleOptions extends ProviderOptions<AppleProfile> {
|
|
63
|
+
clientId: string | string[];
|
|
64
|
+
appBundleIdentifier?: string | undefined;
|
|
65
|
+
audience?: (string | string[]) | undefined;
|
|
66
|
+
}
|
|
67
|
+
declare const apple: (options: AppleOptions) => {
|
|
68
|
+
id: "apple";
|
|
69
|
+
name: string;
|
|
70
|
+
createAuthorizationURL({
|
|
71
|
+
state,
|
|
72
|
+
scopes,
|
|
73
|
+
redirectURI
|
|
74
|
+
}: {
|
|
75
|
+
state: string;
|
|
76
|
+
codeVerifier: string;
|
|
77
|
+
scopes?: string[] | undefined;
|
|
78
|
+
redirectURI: string;
|
|
79
|
+
display?: string | undefined;
|
|
80
|
+
loginHint?: string | undefined;
|
|
81
|
+
}): Promise<URL>;
|
|
82
|
+
validateAuthorizationCode: ({
|
|
83
|
+
code,
|
|
84
|
+
codeVerifier,
|
|
85
|
+
redirectURI
|
|
86
|
+
}: {
|
|
87
|
+
code: string;
|
|
88
|
+
redirectURI: string;
|
|
89
|
+
codeVerifier?: string | undefined;
|
|
90
|
+
deviceId?: string | undefined;
|
|
91
|
+
}) => Promise<OAuth2Tokens>;
|
|
92
|
+
verifyIdToken(token: string, nonce: string | undefined): Promise<boolean>;
|
|
93
|
+
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
94
|
+
getUserInfo(token: OAuth2Tokens & {
|
|
95
|
+
user?: {
|
|
96
|
+
name?
|
|
97
|
+
/**
|
|
98
|
+
* An Integer value that indicates whether the user appears to be a real
|
|
99
|
+
* person. Use the value of this claim to mitigate fraud. The possible
|
|
100
|
+
* values are: 0 (or Unsupported), 1 (or Unknown), 2 (or LikelyReal). For
|
|
101
|
+
* more information, see ASUserDetectionStatus. This claim is present only
|
|
102
|
+
* in iOS 14 and later, macOS 11 and later, watchOS 7 and later, tvOS 14
|
|
103
|
+
* and later. The claim isn’t present or supported for web-based apps.
|
|
104
|
+
*/
|
|
105
|
+
: {
|
|
106
|
+
firstName?: string;
|
|
107
|
+
lastName?: string;
|
|
108
|
+
};
|
|
109
|
+
email?: string;
|
|
110
|
+
} | undefined;
|
|
111
|
+
}): Promise<{
|
|
112
|
+
user: {
|
|
113
|
+
id: string;
|
|
114
|
+
name?: string;
|
|
115
|
+
email?: string | null;
|
|
116
|
+
image?: string;
|
|
117
|
+
emailVerified: boolean;
|
|
118
|
+
[key: string]: any;
|
|
119
|
+
};
|
|
120
|
+
data: any;
|
|
121
|
+
} | null>;
|
|
122
|
+
options: AppleOptions;
|
|
123
|
+
};
|
|
124
|
+
declare const getApplePublicKey: (kid: string) => Promise<Uint8Array<ArrayBufferLike> | CryptoKey>;
|
|
125
|
+
//#endregion
|
|
126
|
+
export { AppleNonConformUser, AppleOptions, AppleProfile, apple, getApplePublicKey };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { APIError, BetterAuthError } from "../error/index.mjs";
|
|
2
|
+
import { logger } from "../env/logger.mjs";
|
|
3
|
+
import { getPrimaryClientId } from "../oauth2/utils.mjs";
|
|
4
|
+
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
5
|
+
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
6
|
+
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
7
|
+
import { betterFetch } from "@better-fetch/fetch";
|
|
8
|
+
import { decodeJwt, decodeProtectedHeader, importJWK, jwtVerify } from "jose";
|
|
9
|
+
//#region src/social-providers/apple.ts
|
|
10
|
+
const apple = (options) => {
|
|
11
|
+
const tokenEndpoint = "https://appleid.apple.com/auth/token";
|
|
12
|
+
return {
|
|
13
|
+
id: "apple",
|
|
14
|
+
name: "Apple",
|
|
15
|
+
async createAuthorizationURL({ state, scopes, redirectURI }) {
|
|
16
|
+
if (!getPrimaryClientId(options.clientId) || !options.clientSecret) {
|
|
17
|
+
logger.error("Client ID and client secret are required for Apple. Make sure to provide them in the options.");
|
|
18
|
+
throw new BetterAuthError("CLIENT_ID_AND_SECRET_REQUIRED");
|
|
19
|
+
}
|
|
20
|
+
const _scope = options.disableDefaultScope ? [] : ["email", "name"];
|
|
21
|
+
if (options.scope) _scope.push(...options.scope);
|
|
22
|
+
if (scopes) _scope.push(...scopes);
|
|
23
|
+
return await createAuthorizationURL({
|
|
24
|
+
id: "apple",
|
|
25
|
+
options,
|
|
26
|
+
authorizationEndpoint: "https://appleid.apple.com/auth/authorize",
|
|
27
|
+
scopes: _scope,
|
|
28
|
+
state,
|
|
29
|
+
redirectURI,
|
|
30
|
+
responseMode: "form_post",
|
|
31
|
+
responseType: "code id_token"
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
validateAuthorizationCode: async ({ code, codeVerifier, redirectURI }) => {
|
|
35
|
+
return validateAuthorizationCode({
|
|
36
|
+
code,
|
|
37
|
+
codeVerifier,
|
|
38
|
+
redirectURI,
|
|
39
|
+
options,
|
|
40
|
+
tokenEndpoint
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
async verifyIdToken(token, nonce) {
|
|
44
|
+
if (options.disableIdTokenSignIn) return false;
|
|
45
|
+
if (options.verifyIdToken) return options.verifyIdToken(token, nonce);
|
|
46
|
+
try {
|
|
47
|
+
const { kid, alg: jwtAlg } = decodeProtectedHeader(token);
|
|
48
|
+
if (!kid || !jwtAlg) return false;
|
|
49
|
+
const { payload: jwtClaims } = await jwtVerify(token, await getApplePublicKey(kid), {
|
|
50
|
+
algorithms: [jwtAlg],
|
|
51
|
+
issuer: "https://appleid.apple.com",
|
|
52
|
+
audience: options.audience && options.audience.length ? options.audience : options.appBundleIdentifier ? options.appBundleIdentifier : options.clientId,
|
|
53
|
+
maxTokenAge: "1h"
|
|
54
|
+
});
|
|
55
|
+
["email_verified", "is_private_email"].forEach((field) => {
|
|
56
|
+
if (jwtClaims[field] !== void 0) jwtClaims[field] = Boolean(jwtClaims[field]);
|
|
57
|
+
});
|
|
58
|
+
if (nonce && jwtClaims.nonce !== nonce) return false;
|
|
59
|
+
return !!jwtClaims;
|
|
60
|
+
} catch {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
refreshAccessToken: options.refreshAccessToken ? options.refreshAccessToken : async (refreshToken) => {
|
|
65
|
+
return refreshAccessToken({
|
|
66
|
+
refreshToken,
|
|
67
|
+
options,
|
|
68
|
+
tokenEndpoint
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
async getUserInfo(token) {
|
|
72
|
+
if (options.getUserInfo) return options.getUserInfo(token);
|
|
73
|
+
if (!token.idToken) return null;
|
|
74
|
+
const profile = decodeJwt(token.idToken);
|
|
75
|
+
if (!profile) return null;
|
|
76
|
+
let name;
|
|
77
|
+
if (token.user?.name) name = `${token.user.name.firstName || ""} ${token.user.name.lastName || ""}`.trim();
|
|
78
|
+
else name = profile.name || "";
|
|
79
|
+
const emailVerified = typeof profile.email_verified === "boolean" ? profile.email_verified : profile.email_verified === "true";
|
|
80
|
+
const enrichedProfile = {
|
|
81
|
+
...profile,
|
|
82
|
+
name
|
|
83
|
+
};
|
|
84
|
+
const userMap = await options.mapProfileToUser?.(enrichedProfile);
|
|
85
|
+
return {
|
|
86
|
+
user: {
|
|
87
|
+
id: profile.sub,
|
|
88
|
+
name: enrichedProfile.name,
|
|
89
|
+
emailVerified,
|
|
90
|
+
email: profile.email,
|
|
91
|
+
...userMap
|
|
92
|
+
},
|
|
93
|
+
data: enrichedProfile
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
options
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
const getApplePublicKey = async (kid) => {
|
|
100
|
+
const { data } = await betterFetch(`https://appleid.apple.com/auth/keys`);
|
|
101
|
+
if (!data?.keys) throw new APIError("BAD_REQUEST", { message: "Keys not found" });
|
|
102
|
+
const jwk = data.keys.find((key) => key.kid === kid);
|
|
103
|
+
if (!jwk) throw new Error(`JWK with kid ${kid} not found`);
|
|
104
|
+
return await importJWK(jwk, jwk.alg);
|
|
105
|
+
};
|
|
106
|
+
//#endregion
|
|
107
|
+
export { apple, getApplePublicKey };
|
package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/atlassian.d.mts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { OAuth2Tokens, ProviderOptions } from "../oauth2/oauth-provider.mjs";
|
|
2
|
+
//#region src/social-providers/atlassian.d.ts
|
|
3
|
+
interface AtlassianProfile {
|
|
4
|
+
account_type?: string | undefined;
|
|
5
|
+
account_id: string;
|
|
6
|
+
email?: string | undefined;
|
|
7
|
+
name: string;
|
|
8
|
+
picture?: string | undefined;
|
|
9
|
+
nickname?: string | undefined;
|
|
10
|
+
locale?: string | undefined;
|
|
11
|
+
extended_profile?: {
|
|
12
|
+
job_title?: string;
|
|
13
|
+
organization?: string;
|
|
14
|
+
department?: string;
|
|
15
|
+
location?: string;
|
|
16
|
+
} | undefined;
|
|
17
|
+
}
|
|
18
|
+
interface AtlassianOptions extends ProviderOptions<AtlassianProfile> {
|
|
19
|
+
clientId: string;
|
|
20
|
+
}
|
|
21
|
+
declare const atlassian: (options: AtlassianOptions) => {
|
|
22
|
+
id: "atlassian";
|
|
23
|
+
name: string;
|
|
24
|
+
createAuthorizationURL({
|
|
25
|
+
state,
|
|
26
|
+
scopes,
|
|
27
|
+
codeVerifier,
|
|
28
|
+
redirectURI
|
|
29
|
+
}: {
|
|
30
|
+
state: string;
|
|
31
|
+
codeVerifier: string;
|
|
32
|
+
scopes?: string[] | undefined;
|
|
33
|
+
redirectURI: string;
|
|
34
|
+
display?: string | undefined;
|
|
35
|
+
loginHint?: string | undefined;
|
|
36
|
+
}): Promise<URL>;
|
|
37
|
+
validateAuthorizationCode: ({
|
|
38
|
+
code,
|
|
39
|
+
codeVerifier,
|
|
40
|
+
redirectURI
|
|
41
|
+
}: {
|
|
42
|
+
code: string;
|
|
43
|
+
redirectURI: string;
|
|
44
|
+
codeVerifier?: string | undefined;
|
|
45
|
+
deviceId?: string | undefined;
|
|
46
|
+
}) => Promise<OAuth2Tokens>;
|
|
47
|
+
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
48
|
+
getUserInfo(token: OAuth2Tokens & {
|
|
49
|
+
user?: {
|
|
50
|
+
name?: {
|
|
51
|
+
firstName?: string;
|
|
52
|
+
lastName?: string;
|
|
53
|
+
};
|
|
54
|
+
email?: string;
|
|
55
|
+
} | undefined;
|
|
56
|
+
}): Promise<{
|
|
57
|
+
user: {
|
|
58
|
+
id: string;
|
|
59
|
+
name?: string;
|
|
60
|
+
email?: string | null;
|
|
61
|
+
image?: string;
|
|
62
|
+
emailVerified: boolean;
|
|
63
|
+
[key: string]: any;
|
|
64
|
+
};
|
|
65
|
+
data: any;
|
|
66
|
+
} | null>;
|
|
67
|
+
options: AtlassianOptions;
|
|
68
|
+
};
|
|
69
|
+
//#endregion
|
|
70
|
+
export { AtlassianOptions, AtlassianProfile, atlassian };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { BetterAuthError } from "../error/index.mjs";
|
|
2
|
+
import { logger } from "../env/logger.mjs";
|
|
3
|
+
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
4
|
+
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
5
|
+
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
6
|
+
import { betterFetch } from "@better-fetch/fetch";
|
|
7
|
+
//#region src/social-providers/atlassian.ts
|
|
8
|
+
const atlassian = (options) => {
|
|
9
|
+
const tokenEndpoint = "https://auth.atlassian.com/oauth/token";
|
|
10
|
+
return {
|
|
11
|
+
id: "atlassian",
|
|
12
|
+
name: "Atlassian",
|
|
13
|
+
async createAuthorizationURL({ state, scopes, codeVerifier, redirectURI }) {
|
|
14
|
+
if (!options.clientId || !options.clientSecret) {
|
|
15
|
+
logger.error("Client Id and Secret are required for Atlassian");
|
|
16
|
+
throw new BetterAuthError("CLIENT_ID_AND_SECRET_REQUIRED");
|
|
17
|
+
}
|
|
18
|
+
if (!codeVerifier) throw new BetterAuthError("codeVerifier is required for Atlassian");
|
|
19
|
+
const _scopes = options.disableDefaultScope ? [] : ["read:jira-user", "offline_access"];
|
|
20
|
+
if (options.scope) _scopes.push(...options.scope);
|
|
21
|
+
if (scopes) _scopes.push(...scopes);
|
|
22
|
+
return createAuthorizationURL({
|
|
23
|
+
id: "atlassian",
|
|
24
|
+
options,
|
|
25
|
+
authorizationEndpoint: "https://auth.atlassian.com/authorize",
|
|
26
|
+
scopes: _scopes,
|
|
27
|
+
state,
|
|
28
|
+
codeVerifier,
|
|
29
|
+
redirectURI,
|
|
30
|
+
additionalParams: { audience: "api.atlassian.com" },
|
|
31
|
+
prompt: options.prompt
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
validateAuthorizationCode: async ({ code, codeVerifier, redirectURI }) => {
|
|
35
|
+
return validateAuthorizationCode({
|
|
36
|
+
code,
|
|
37
|
+
codeVerifier,
|
|
38
|
+
redirectURI,
|
|
39
|
+
options,
|
|
40
|
+
tokenEndpoint
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
refreshAccessToken: options.refreshAccessToken ? options.refreshAccessToken : async (refreshToken) => {
|
|
44
|
+
return refreshAccessToken({
|
|
45
|
+
refreshToken,
|
|
46
|
+
options: {
|
|
47
|
+
clientId: options.clientId,
|
|
48
|
+
clientSecret: options.clientSecret
|
|
49
|
+
},
|
|
50
|
+
tokenEndpoint
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
async getUserInfo(token) {
|
|
54
|
+
if (options.getUserInfo) return options.getUserInfo(token);
|
|
55
|
+
if (!token.accessToken) return null;
|
|
56
|
+
try {
|
|
57
|
+
const { data: profile } = await betterFetch("https://api.atlassian.com/me", { headers: { Authorization: `Bearer ${token.accessToken}` } });
|
|
58
|
+
if (!profile) return null;
|
|
59
|
+
const userMap = await options.mapProfileToUser?.(profile);
|
|
60
|
+
return {
|
|
61
|
+
user: {
|
|
62
|
+
id: profile.account_id,
|
|
63
|
+
name: profile.name,
|
|
64
|
+
email: profile.email,
|
|
65
|
+
image: profile.picture,
|
|
66
|
+
emailVerified: false,
|
|
67
|
+
...userMap
|
|
68
|
+
},
|
|
69
|
+
data: profile
|
|
70
|
+
};
|
|
71
|
+
} catch (error) {
|
|
72
|
+
logger.error("Failed to fetch user info from Figma:", error);
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
options
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
//#endregion
|
|
80
|
+
export { atlassian };
|