create-croissant 0.1.7 → 0.1.9
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/package.json +1 -1
- package/template/apps/web/package.json +4 -0
- package/template/apps/web/src/components/login-form.tsx +95 -48
- package/template/apps/web/src/components/signup-form.tsx +149 -79
- package/template/apps/web/src/routes/__root.tsx +18 -11
- package/template/apps/web/src/routes/client-orpc-auth.tsx +8 -20
- package/template/apps/web/src/routes/client-orpc.tsx +269 -24
- package/template/apps/web/src/routes/isr.tsx +4 -0
- package/template/apps/web/src/routes/ssr-orpc.tsx +245 -18
- package/template/apps/web/vite.config.ts +5 -1
- package/template/package.json +3 -1
- package/template/packages/orpc/src/lib/router.ts +63 -0
- package/template/apps/web/node_modules/@better-auth/core/LICENSE.md +0 -20
- package/template/apps/web/node_modules/@better-auth/core/README.md +0 -17
- package/template/apps/web/node_modules/@better-auth/core/dist/api/index.d.mts +0 -278
- package/template/apps/web/node_modules/@better-auth/core/dist/api/index.mjs +0 -56
- package/template/apps/web/node_modules/@better-auth/core/dist/async_hooks/index.d.mts +0 -6
- package/template/apps/web/node_modules/@better-auth/core/dist/async_hooks/index.mjs +0 -20
- package/template/apps/web/node_modules/@better-auth/core/dist/async_hooks/pure.index.d.mts +0 -6
- package/template/apps/web/node_modules/@better-auth/core/dist/async_hooks/pure.index.mjs +0 -33
- package/template/apps/web/node_modules/@better-auth/core/dist/context/endpoint-context.d.mts +0 -18
- package/template/apps/web/node_modules/@better-auth/core/dist/context/endpoint-context.mjs +0 -29
- package/template/apps/web/node_modules/@better-auth/core/dist/context/global.d.mts +0 -6
- package/template/apps/web/node_modules/@better-auth/core/dist/context/global.mjs +0 -36
- package/template/apps/web/node_modules/@better-auth/core/dist/context/index.d.mts +0 -5
- package/template/apps/web/node_modules/@better-auth/core/dist/context/index.mjs +0 -5
- package/template/apps/web/node_modules/@better-auth/core/dist/context/request-state.d.mts +0 -27
- package/template/apps/web/node_modules/@better-auth/core/dist/context/request-state.mjs +0 -47
- package/template/apps/web/node_modules/@better-auth/core/dist/context/transaction.d.mts +0 -24
- package/template/apps/web/node_modules/@better-auth/core/dist/context/transaction.mjs +0 -93
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/factory.d.mts +0 -17
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/factory.mjs +0 -754
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-default-field-name.d.mts +0 -18
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-default-field-name.mjs +0 -36
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-default-model-name.d.mts +0 -12
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-default-model-name.mjs +0 -30
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-field-attributes.d.mts +0 -26
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-field-attributes.mjs +0 -37
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-field-name.d.mts +0 -18
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-field-name.mjs +0 -31
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-id-field.d.mts +0 -36
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-id-field.mjs +0 -64
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-model-name.d.mts +0 -12
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-model-name.mjs +0 -21
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/index.d.mts +0 -525
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/index.mjs +0 -24
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/types.d.mts +0 -105
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/utils.d.mts +0 -7
- package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/utils.mjs +0 -37
- package/template/apps/web/node_modules/@better-auth/core/dist/db/get-tables.d.mts +0 -6
- package/template/apps/web/node_modules/@better-auth/core/dist/db/get-tables.mjs +0 -265
- package/template/apps/web/node_modules/@better-auth/core/dist/db/index.d.mts +0 -10
- package/template/apps/web/node_modules/@better-auth/core/dist/db/index.mjs +0 -8
- package/template/apps/web/node_modules/@better-auth/core/dist/db/plugin.d.mts +0 -12
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/account.d.mts +0 -28
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/account.mjs +0 -17
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/rate-limit.d.mts +0 -18
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/rate-limit.mjs +0 -9
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/session.d.mts +0 -23
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/session.mjs +0 -12
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/shared.d.mts +0 -10
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/shared.mjs +0 -9
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/user.d.mts +0 -22
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/user.mjs +0 -11
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/verification.d.mts +0 -21
- package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/verification.mjs +0 -10
- package/template/apps/web/node_modules/@better-auth/core/dist/db/type.d.mts +0 -167
- package/template/apps/web/node_modules/@better-auth/core/dist/env/color-depth.d.mts +0 -4
- package/template/apps/web/node_modules/@better-auth/core/dist/env/color-depth.mjs +0 -86
- package/template/apps/web/node_modules/@better-auth/core/dist/env/env-impl.d.mts +0 -32
- package/template/apps/web/node_modules/@better-auth/core/dist/env/env-impl.mjs +0 -81
- package/template/apps/web/node_modules/@better-auth/core/dist/env/index.d.mts +0 -4
- package/template/apps/web/node_modules/@better-auth/core/dist/env/index.mjs +0 -4
- package/template/apps/web/node_modules/@better-auth/core/dist/env/logger.d.mts +0 -48
- package/template/apps/web/node_modules/@better-auth/core/dist/env/logger.mjs +0 -79
- package/template/apps/web/node_modules/@better-auth/core/dist/error/codes.d.mts +0 -68
- package/template/apps/web/node_modules/@better-auth/core/dist/error/codes.mjs +0 -54
- package/template/apps/web/node_modules/@better-auth/core/dist/error/index.d.mts +0 -19
- package/template/apps/web/node_modules/@better-auth/core/dist/error/index.mjs +0 -27
- package/template/apps/web/node_modules/@better-auth/core/dist/index.d.mts +0 -9
- package/template/apps/web/node_modules/@better-auth/core/dist/index.mjs +0 -1
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/api.mjs +0 -12
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/attributes.d.mts +0 -11
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/attributes.mjs +0 -10
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/index.d.mts +0 -3
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/index.mjs +0 -3
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/noop.mjs +0 -42
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/pure.index.d.mts +0 -7
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/pure.index.mjs +0 -7
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/tracer.d.mts +0 -13
- package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/tracer.mjs +0 -53
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/client-credentials-token.d.mts +0 -56
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/client-credentials-token.mjs +0 -64
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/create-authorization-url.d.mts +0 -44
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/create-authorization-url.mjs +0 -41
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/index.d.mts +0 -8
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/index.mjs +0 -7
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/oauth-provider.d.mts +0 -192
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/refresh-access-token.d.mts +0 -54
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/refresh-access-token.mjs +0 -73
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/utils.d.mts +0 -16
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/utils.mjs +0 -37
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/validate-authorization-code.d.mts +0 -85
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/validate-authorization-code.mjs +0 -79
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/verify.d.mts +0 -42
- package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/verify.mjs +0 -92
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/apple.d.mts +0 -126
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/apple.mjs +0 -107
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/atlassian.d.mts +0 -70
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/atlassian.mjs +0 -80
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/cognito.d.mts +0 -85
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/cognito.mjs +0 -162
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/discord.d.mts +0 -124
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/discord.mjs +0 -62
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/dropbox.d.mts +0 -69
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/dropbox.mjs +0 -72
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/facebook.d.mts +0 -79
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/facebook.mjs +0 -124
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/figma.d.mts +0 -61
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/figma.mjs +0 -83
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/github.d.mts +0 -102
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/github.mjs +0 -92
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/gitlab.d.mts +0 -123
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/gitlab.mjs +0 -79
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/google.d.mts +0 -97
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/google.mjs +0 -109
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/huggingface.d.mts +0 -83
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/huggingface.mjs +0 -73
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/index.d.mts +0 -1834
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/index.mjs +0 -78
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/kakao.d.mts +0 -161
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/kakao.mjs +0 -70
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/kick.d.mts +0 -73
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/kick.mjs +0 -68
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/line.d.mts +0 -105
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/line.mjs +0 -110
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linear.d.mts +0 -68
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linear.mjs +0 -85
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linkedin.d.mts +0 -67
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linkedin.mjs +0 -73
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/microsoft-entra-id.d.mts +0 -174
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/microsoft-entra-id.mjs +0 -140
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/naver.d.mts +0 -92
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/naver.mjs +0 -65
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/notion.d.mts +0 -64
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/notion.mjs +0 -72
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/paybin.d.mts +0 -71
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/paybin.mjs +0 -81
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/paypal.d.mts +0 -129
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/paypal.mjs +0 -140
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/polar.d.mts +0 -74
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/polar.mjs +0 -71
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/railway.d.mts +0 -65
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/railway.mjs +0 -74
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/reddit.d.mts +0 -62
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/reddit.mjs +0 -80
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/roblox.d.mts +0 -70
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/roblox.mjs +0 -57
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/salesforce.d.mts +0 -79
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/salesforce.mjs +0 -87
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/slack.d.mts +0 -83
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/slack.mjs +0 -66
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/spotify.d.mts +0 -63
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/spotify.mjs +0 -69
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/tiktok.d.mts +0 -168
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/tiktok.mjs +0 -60
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/twitch.d.mts +0 -79
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/twitch.mjs +0 -75
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/twitter.d.mts +0 -126
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/twitter.mjs +0 -85
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/vercel.d.mts +0 -62
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/vercel.mjs +0 -58
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/vk.d.mts +0 -70
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/vk.mjs +0 -81
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/wechat.d.mts +0 -113
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/wechat.mjs +0 -81
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/zoom.d.mts +0 -163
- package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/zoom.mjs +0 -69
- package/template/apps/web/node_modules/@better-auth/core/dist/types/context.d.mts +0 -277
- package/template/apps/web/node_modules/@better-auth/core/dist/types/cookie.d.mts +0 -15
- package/template/apps/web/node_modules/@better-auth/core/dist/types/helper.d.mts +0 -10
- package/template/apps/web/node_modules/@better-auth/core/dist/types/index.d.mts +0 -9
- package/template/apps/web/node_modules/@better-auth/core/dist/types/init-options.d.mts +0 -1358
- package/template/apps/web/node_modules/@better-auth/core/dist/types/plugin-client.d.mts +0 -113
- package/template/apps/web/node_modules/@better-auth/core/dist/types/plugin.d.mts +0 -124
- package/template/apps/web/node_modules/@better-auth/core/dist/types/secret.d.mts +0 -11
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/async.d.mts +0 -22
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/async.mjs +0 -32
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/db.d.mts +0 -9
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/db.mjs +0 -15
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/deprecate.d.mts +0 -9
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/deprecate.mjs +0 -16
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/error-codes.d.mts +0 -13
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/error-codes.mjs +0 -10
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/fetch-metadata.d.mts +0 -4
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/fetch-metadata.mjs +0 -6
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/host.d.mts +0 -147
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/host.mjs +0 -291
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/id.d.mts +0 -4
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/id.mjs +0 -7
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/ip.d.mts +0 -54
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/ip.mjs +0 -116
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/is-api-error.d.mts +0 -6
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/is-api-error.mjs +0 -8
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/json.d.mts +0 -4
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/json.mjs +0 -41
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/string.d.mts +0 -4
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/string.mjs +0 -6
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/url.d.mts +0 -20
- package/template/apps/web/node_modules/@better-auth/core/dist/utils/url.mjs +0 -31
- package/template/apps/web/node_modules/@better-auth/core/package.json +0 -193
- package/template/apps/web/node_modules/@better-auth/core/src/api/index.ts +0 -140
- package/template/apps/web/node_modules/@better-auth/core/src/async_hooks/index.ts +0 -40
- package/template/apps/web/node_modules/@better-auth/core/src/async_hooks/pure.index.ts +0 -46
- package/template/apps/web/node_modules/@better-auth/core/src/context/endpoint-context.ts +0 -50
- package/template/apps/web/node_modules/@better-auth/core/src/context/global.ts +0 -57
- package/template/apps/web/node_modules/@better-auth/core/src/context/index.ts +0 -23
- package/template/apps/web/node_modules/@better-auth/core/src/context/request-state.ts +0 -91
- package/template/apps/web/node_modules/@better-auth/core/src/context/transaction.ts +0 -136
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/factory.ts +0 -1440
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-default-field-name.ts +0 -59
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-default-model-name.ts +0 -51
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-field-attributes.ts +0 -62
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-field-name.ts +0 -43
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-id-field.ts +0 -150
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-model-name.ts +0 -36
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/index.ts +0 -567
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/types.ts +0 -132
- package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/utils.ts +0 -61
- package/template/apps/web/node_modules/@better-auth/core/src/db/get-tables.ts +0 -296
- package/template/apps/web/node_modules/@better-auth/core/src/db/index.ts +0 -43
- package/template/apps/web/node_modules/@better-auth/core/src/db/plugin.ts +0 -11
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/account.ts +0 -47
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/rate-limit.ts +0 -36
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/session.ts +0 -29
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/shared.ts +0 -7
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/user.ts +0 -28
- package/template/apps/web/node_modules/@better-auth/core/src/db/schema/verification.ts +0 -28
- package/template/apps/web/node_modules/@better-auth/core/src/db/type.ts +0 -333
- package/template/apps/web/node_modules/@better-auth/core/src/env/color-depth.ts +0 -172
- package/template/apps/web/node_modules/@better-auth/core/src/env/env-impl.ts +0 -124
- package/template/apps/web/node_modules/@better-auth/core/src/env/index.ts +0 -23
- package/template/apps/web/node_modules/@better-auth/core/src/env/logger.ts +0 -145
- package/template/apps/web/node_modules/@better-auth/core/src/error/codes.ts +0 -71
- package/template/apps/web/node_modules/@better-auth/core/src/error/index.ts +0 -35
- package/template/apps/web/node_modules/@better-auth/core/src/index.ts +0 -1
- package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/api.ts +0 -17
- package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/attributes.ts +0 -22
- package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/index.ts +0 -2
- package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/noop.ts +0 -74
- package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/pure.index.ts +0 -31
- package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/tracer.ts +0 -95
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/client-credentials-token.ts +0 -126
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/create-authorization-url.ts +0 -89
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/index.ts +0 -33
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/oauth-provider.ts +0 -222
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/refresh-access-token.ts +0 -157
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/utils.ts +0 -51
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/validate-authorization-code.ts +0 -180
- package/template/apps/web/node_modules/@better-auth/core/src/oauth2/verify.ts +0 -221
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/apple.ts +0 -231
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/atlassian.ts +0 -133
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/cognito.ts +0 -281
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/discord.ts +0 -170
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/dropbox.ts +0 -112
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/facebook.ts +0 -215
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/figma.ts +0 -118
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/github.ts +0 -184
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/gitlab.ts +0 -155
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/google.ts +0 -204
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/huggingface.ts +0 -119
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/index.ts +0 -132
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/kakao.ts +0 -179
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/kick.ts +0 -109
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/line.ts +0 -169
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/linear.ts +0 -121
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/linkedin.ts +0 -110
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/microsoft-entra-id.ts +0 -352
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/naver.ts +0 -113
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/notion.ts +0 -108
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/paybin.ts +0 -118
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/paypal.ts +0 -263
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/polar.ts +0 -111
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/railway.ts +0 -100
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/reddit.ts +0 -122
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/roblox.ts +0 -112
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/salesforce.ts +0 -159
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/slack.ts +0 -112
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/spotify.ts +0 -94
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/tiktok.ts +0 -211
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/twitch.ts +0 -112
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/twitter.ts +0 -199
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/vercel.ts +0 -87
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/vk.ts +0 -125
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/wechat.ts +0 -213
- package/template/apps/web/node_modules/@better-auth/core/src/social-providers/zoom.ts +0 -230
- package/template/apps/web/node_modules/@better-auth/core/src/types/context.ts +0 -415
- package/template/apps/web/node_modules/@better-auth/core/src/types/cookie.ts +0 -10
- package/template/apps/web/node_modules/@better-auth/core/src/types/helper.ts +0 -27
- package/template/apps/web/node_modules/@better-auth/core/src/types/index.ts +0 -40
- package/template/apps/web/node_modules/@better-auth/core/src/types/init-options.ts +0 -1610
- package/template/apps/web/node_modules/@better-auth/core/src/types/plugin-client.ts +0 -129
- package/template/apps/web/node_modules/@better-auth/core/src/types/plugin.ts +0 -163
- package/template/apps/web/node_modules/@better-auth/core/src/types/secret.ts +0 -8
- package/template/apps/web/node_modules/@better-auth/core/src/utils/async.ts +0 -53
- package/template/apps/web/node_modules/@better-auth/core/src/utils/db.ts +0 -20
- package/template/apps/web/node_modules/@better-auth/core/src/utils/deprecate.ts +0 -21
- package/template/apps/web/node_modules/@better-auth/core/src/utils/error-codes.ts +0 -68
- package/template/apps/web/node_modules/@better-auth/core/src/utils/fetch-metadata.ts +0 -3
- package/template/apps/web/node_modules/@better-auth/core/src/utils/host.ts +0 -401
- package/template/apps/web/node_modules/@better-auth/core/src/utils/id.ts +0 -5
- package/template/apps/web/node_modules/@better-auth/core/src/utils/ip.ts +0 -211
- package/template/apps/web/node_modules/@better-auth/core/src/utils/is-api-error.ts +0 -10
- package/template/apps/web/node_modules/@better-auth/core/src/utils/json.ts +0 -56
- package/template/apps/web/node_modules/@better-auth/core/src/utils/string.ts +0 -3
- package/template/apps/web/node_modules/@better-auth/core/src/utils/url.ts +0 -43
- package/template/apps/web/node_modules/@better-auth/utils/README.md +0 -384
- package/template/apps/web/node_modules/@better-auth/utils/dist/base32.cjs +0 -104
- package/template/apps/web/node_modules/@better-auth/utils/dist/base32.d.cts +0 -44
- package/template/apps/web/node_modules/@better-auth/utils/dist/base32.d.mts +0 -44
- package/template/apps/web/node_modules/@better-auth/utils/dist/base32.d.ts +0 -44
- package/template/apps/web/node_modules/@better-auth/utils/dist/base32.mjs +0 -101
- package/template/apps/web/node_modules/@better-auth/utils/dist/base64.cjs +0 -80
- package/template/apps/web/node_modules/@better-auth/utils/dist/base64.d.cts +0 -16
- package/template/apps/web/node_modules/@better-auth/utils/dist/base64.d.mts +0 -16
- package/template/apps/web/node_modules/@better-auth/utils/dist/base64.d.ts +0 -16
- package/template/apps/web/node_modules/@better-auth/utils/dist/base64.mjs +0 -77
- package/template/apps/web/node_modules/@better-auth/utils/dist/binary.cjs +0 -16
- package/template/apps/web/node_modules/@better-auth/utils/dist/binary.d.cts +0 -8
- package/template/apps/web/node_modules/@better-auth/utils/dist/binary.d.mts +0 -8
- package/template/apps/web/node_modules/@better-auth/utils/dist/binary.d.ts +0 -8
- package/template/apps/web/node_modules/@better-auth/utils/dist/binary.mjs +0 -14
- package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.cjs +0 -90
- package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.d.cts +0 -19
- package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.d.mts +0 -19
- package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.d.ts +0 -19
- package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.mjs +0 -88
- package/template/apps/web/node_modules/@better-auth/utils/dist/hash.cjs +0 -31
- package/template/apps/web/node_modules/@better-auth/utils/dist/hash.d.cts +0 -7
- package/template/apps/web/node_modules/@better-auth/utils/dist/hash.d.mts +0 -7
- package/template/apps/web/node_modules/@better-auth/utils/dist/hash.d.ts +0 -7
- package/template/apps/web/node_modules/@better-auth/utils/dist/hash.mjs +0 -29
- package/template/apps/web/node_modules/@better-auth/utils/dist/hex.cjs +0 -40
- package/template/apps/web/node_modules/@better-auth/utils/dist/hex.d.cts +0 -8
- package/template/apps/web/node_modules/@better-auth/utils/dist/hex.d.mts +0 -8
- package/template/apps/web/node_modules/@better-auth/utils/dist/hex.d.ts +0 -8
- package/template/apps/web/node_modules/@better-auth/utils/dist/hex.mjs +0 -38
- package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.cjs +0 -58
- package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.d.cts +0 -9
- package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.d.mts +0 -9
- package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.d.ts +0 -9
- package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.mjs +0 -56
- package/template/apps/web/node_modules/@better-auth/utils/dist/index.cjs +0 -10
- package/template/apps/web/node_modules/@better-auth/utils/dist/index.d.cts +0 -3
- package/template/apps/web/node_modules/@better-auth/utils/dist/index.d.mts +0 -3
- package/template/apps/web/node_modules/@better-auth/utils/dist/index.d.ts +0 -3
- package/template/apps/web/node_modules/@better-auth/utils/dist/index.mjs +0 -8
- package/template/apps/web/node_modules/@better-auth/utils/dist/otp.cjs +0 -90
- package/template/apps/web/node_modules/@better-auth/utils/dist/otp.d.cts +0 -13
- package/template/apps/web/node_modules/@better-auth/utils/dist/otp.d.mts +0 -13
- package/template/apps/web/node_modules/@better-auth/utils/dist/otp.d.ts +0 -13
- package/template/apps/web/node_modules/@better-auth/utils/dist/otp.mjs +0 -88
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.cjs +0 -36
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.d.cts +0 -4
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.d.mts +0 -4
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.d.ts +0 -4
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.mjs +0 -33
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.cjs +0 -47
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.d.cts +0 -4
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.d.mts +0 -4
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.d.ts +0 -4
- package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.mjs +0 -44
- package/template/apps/web/node_modules/@better-auth/utils/dist/random.cjs +0 -55
- package/template/apps/web/node_modules/@better-auth/utils/dist/random.d.cts +0 -4
- package/template/apps/web/node_modules/@better-auth/utils/dist/random.d.mts +0 -4
- package/template/apps/web/node_modules/@better-auth/utils/dist/random.d.ts +0 -4
- package/template/apps/web/node_modules/@better-auth/utils/dist/random.mjs +0 -53
- package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.cjs +0 -76
- package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.d.cts +0 -16
- package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.d.mts +0 -16
- package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.d.ts +0 -16
- package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.mjs +0 -74
- package/template/apps/web/node_modules/@better-auth/utils/dist/shared/utils.ecd028f7.d.cts +0 -22
- package/template/apps/web/node_modules/@better-auth/utils/dist/shared/utils.ecd028f7.d.mts +0 -22
- package/template/apps/web/node_modules/@better-auth/utils/dist/shared/utils.ecd028f7.d.ts +0 -22
- package/template/apps/web/node_modules/@better-auth/utils/package.json +0 -95
- package/template/apps/web/node_modules/better-call/LICENSE +0 -21
- package/template/apps/web/node_modules/better-call/dist/_virtual/_rolldown/runtime.cjs +0 -29
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.cjs +0 -181
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.cjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.d.cts +0 -16
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.d.mts +0 -16
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.mjs +0 -178
- package/template/apps/web/node_modules/better-call/dist/adapters/node/request.mjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/client.cjs +0 -23
- package/template/apps/web/node_modules/better-call/dist/client.cjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/client.d.cts +0 -53
- package/template/apps/web/node_modules/better-call/dist/client.d.mts +0 -53
- package/template/apps/web/node_modules/better-call/dist/client.mjs +0 -14
- package/template/apps/web/node_modules/better-call/dist/client.mjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/context.cjs +0 -103
- package/template/apps/web/node_modules/better-call/dist/context.cjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/context.d.cts +0 -341
- package/template/apps/web/node_modules/better-call/dist/context.d.mts +0 -341
- package/template/apps/web/node_modules/better-call/dist/context.mjs +0 -103
- package/template/apps/web/node_modules/better-call/dist/context.mjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/cookies.cjs +0 -87
- package/template/apps/web/node_modules/better-call/dist/cookies.cjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/cookies.d.cts +0 -103
- package/template/apps/web/node_modules/better-call/dist/cookies.d.mts +0 -103
- package/template/apps/web/node_modules/better-call/dist/cookies.mjs +0 -84
- package/template/apps/web/node_modules/better-call/dist/cookies.mjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/crypto.cjs +0 -39
- package/template/apps/web/node_modules/better-call/dist/crypto.cjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/crypto.mjs +0 -36
- package/template/apps/web/node_modules/better-call/dist/crypto.mjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/endpoint.cjs +0 -70
- package/template/apps/web/node_modules/better-call/dist/endpoint.cjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/endpoint.d.cts +0 -475
- package/template/apps/web/node_modules/better-call/dist/endpoint.d.mts +0 -475
- package/template/apps/web/node_modules/better-call/dist/endpoint.mjs +0 -70
- package/template/apps/web/node_modules/better-call/dist/endpoint.mjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/error.cjs +0 -141
- package/template/apps/web/node_modules/better-call/dist/error.cjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/error.d.cts +0 -103
- package/template/apps/web/node_modules/better-call/dist/error.d.mts +0 -103
- package/template/apps/web/node_modules/better-call/dist/error.mjs +0 -133
- package/template/apps/web/node_modules/better-call/dist/error.mjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/helper.d.cts +0 -12
- package/template/apps/web/node_modules/better-call/dist/helper.d.mts +0 -12
- package/template/apps/web/node_modules/better-call/dist/index.cjs +0 -28
- package/template/apps/web/node_modules/better-call/dist/index.d.cts +0 -11
- package/template/apps/web/node_modules/better-call/dist/index.d.mts +0 -11
- package/template/apps/web/node_modules/better-call/dist/index.mjs +0 -10
- package/template/apps/web/node_modules/better-call/dist/middleware.cjs +0 -52
- package/template/apps/web/node_modules/better-call/dist/middleware.cjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/middleware.d.cts +0 -123
- package/template/apps/web/node_modules/better-call/dist/middleware.d.mts +0 -123
- package/template/apps/web/node_modules/better-call/dist/middleware.mjs +0 -52
- package/template/apps/web/node_modules/better-call/dist/middleware.mjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/node.cjs +0 -18
- package/template/apps/web/node_modules/better-call/dist/node.cjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/node.d.cts +0 -9
- package/template/apps/web/node_modules/better-call/dist/node.d.mts +0 -9
- package/template/apps/web/node_modules/better-call/dist/node.mjs +0 -15
- package/template/apps/web/node_modules/better-call/dist/node.mjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/openapi.cjs +0 -191
- package/template/apps/web/node_modules/better-call/dist/openapi.cjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/openapi.d.cts +0 -113
- package/template/apps/web/node_modules/better-call/dist/openapi.d.mts +0 -113
- package/template/apps/web/node_modules/better-call/dist/openapi.mjs +0 -189
- package/template/apps/web/node_modules/better-call/dist/openapi.mjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/router.cjs +0 -118
- package/template/apps/web/node_modules/better-call/dist/router.cjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/router.d.cts +0 -103
- package/template/apps/web/node_modules/better-call/dist/router.d.mts +0 -103
- package/template/apps/web/node_modules/better-call/dist/router.mjs +0 -117
- package/template/apps/web/node_modules/better-call/dist/router.mjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/standard-schema.d.cts +0 -59
- package/template/apps/web/node_modules/better-call/dist/standard-schema.d.mts +0 -59
- package/template/apps/web/node_modules/better-call/dist/to-response.cjs +0 -153
- package/template/apps/web/node_modules/better-call/dist/to-response.cjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/to-response.d.cts +0 -12
- package/template/apps/web/node_modules/better-call/dist/to-response.d.mts +0 -12
- package/template/apps/web/node_modules/better-call/dist/to-response.mjs +0 -153
- package/template/apps/web/node_modules/better-call/dist/to-response.mjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/utils.cjs +0 -86
- package/template/apps/web/node_modules/better-call/dist/utils.cjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/utils.mjs +0 -82
- package/template/apps/web/node_modules/better-call/dist/utils.mjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/validator.cjs +0 -58
- package/template/apps/web/node_modules/better-call/dist/validator.cjs.map +0 -1
- package/template/apps/web/node_modules/better-call/dist/validator.mjs +0 -57
- package/template/apps/web/node_modules/better-call/dist/validator.mjs.map +0 -1
- package/template/apps/web/node_modules/better-call/package.json +0 -96
- package/template/apps/web/node_modules/set-cookie-parser/LICENSE +0 -21
- package/template/apps/web/node_modules/set-cookie-parser/README.md +0 -169
- package/template/apps/web/node_modules/set-cookie-parser/dist/.eslintrc.cjs +0 -16
- package/template/apps/web/node_modules/set-cookie-parser/dist/set-cookie.cjs +0 -260
- package/template/apps/web/node_modules/set-cookie-parser/lib/set-cookie.d.ts +0 -119
- package/template/apps/web/node_modules/set-cookie-parser/lib/set-cookie.js +0 -265
- package/template/apps/web/node_modules/set-cookie-parser/package.json +0 -61
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { OAuth2Tokens, ProviderOptions } from "../oauth2/oauth-provider.mjs";
|
|
2
|
-
//#region src/social-providers/linear.d.ts
|
|
3
|
-
interface LinearUser {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
email: string;
|
|
7
|
-
avatarUrl?: string | undefined;
|
|
8
|
-
active: boolean;
|
|
9
|
-
createdAt: string;
|
|
10
|
-
updatedAt: string;
|
|
11
|
-
}
|
|
12
|
-
interface LinearProfile {
|
|
13
|
-
data: {
|
|
14
|
-
viewer: LinearUser;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
interface LinearOptions extends ProviderOptions<LinearUser> {
|
|
18
|
-
clientId: string;
|
|
19
|
-
}
|
|
20
|
-
declare const linear: (options: LinearOptions) => {
|
|
21
|
-
id: "linear";
|
|
22
|
-
name: string;
|
|
23
|
-
createAuthorizationURL({
|
|
24
|
-
state,
|
|
25
|
-
scopes,
|
|
26
|
-
loginHint,
|
|
27
|
-
redirectURI
|
|
28
|
-
}: {
|
|
29
|
-
state: string;
|
|
30
|
-
codeVerifier: string;
|
|
31
|
-
scopes?: string[] | undefined;
|
|
32
|
-
redirectURI: string;
|
|
33
|
-
display?: string | undefined;
|
|
34
|
-
loginHint?: string | undefined;
|
|
35
|
-
}): Promise<URL>;
|
|
36
|
-
validateAuthorizationCode: ({
|
|
37
|
-
code,
|
|
38
|
-
redirectURI
|
|
39
|
-
}: {
|
|
40
|
-
code: string;
|
|
41
|
-
redirectURI: string;
|
|
42
|
-
codeVerifier?: string | undefined;
|
|
43
|
-
deviceId?: string | undefined;
|
|
44
|
-
}) => Promise<OAuth2Tokens>;
|
|
45
|
-
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
46
|
-
getUserInfo(token: OAuth2Tokens & {
|
|
47
|
-
user?: {
|
|
48
|
-
name?: {
|
|
49
|
-
firstName?: string;
|
|
50
|
-
lastName?: string;
|
|
51
|
-
};
|
|
52
|
-
email?: string;
|
|
53
|
-
} | undefined;
|
|
54
|
-
}): Promise<{
|
|
55
|
-
user: {
|
|
56
|
-
id: string;
|
|
57
|
-
name?: string;
|
|
58
|
-
email?: string | null;
|
|
59
|
-
image?: string;
|
|
60
|
-
emailVerified: boolean;
|
|
61
|
-
[key: string]: any;
|
|
62
|
-
};
|
|
63
|
-
data: any;
|
|
64
|
-
} | null>;
|
|
65
|
-
options: LinearOptions;
|
|
66
|
-
};
|
|
67
|
-
//#endregion
|
|
68
|
-
export { LinearOptions, LinearProfile, LinearUser, linear };
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
2
|
-
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
3
|
-
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
4
|
-
import { betterFetch } from "@better-fetch/fetch";
|
|
5
|
-
//#region src/social-providers/linear.ts
|
|
6
|
-
const linear = (options) => {
|
|
7
|
-
const tokenEndpoint = "https://api.linear.app/oauth/token";
|
|
8
|
-
return {
|
|
9
|
-
id: "linear",
|
|
10
|
-
name: "Linear",
|
|
11
|
-
createAuthorizationURL({ state, scopes, loginHint, redirectURI }) {
|
|
12
|
-
const _scopes = options.disableDefaultScope ? [] : ["read"];
|
|
13
|
-
if (options.scope) _scopes.push(...options.scope);
|
|
14
|
-
if (scopes) _scopes.push(...scopes);
|
|
15
|
-
return createAuthorizationURL({
|
|
16
|
-
id: "linear",
|
|
17
|
-
options,
|
|
18
|
-
authorizationEndpoint: "https://linear.app/oauth/authorize",
|
|
19
|
-
scopes: _scopes,
|
|
20
|
-
state,
|
|
21
|
-
redirectURI,
|
|
22
|
-
loginHint
|
|
23
|
-
});
|
|
24
|
-
},
|
|
25
|
-
validateAuthorizationCode: async ({ code, redirectURI }) => {
|
|
26
|
-
return validateAuthorizationCode({
|
|
27
|
-
code,
|
|
28
|
-
redirectURI,
|
|
29
|
-
options,
|
|
30
|
-
tokenEndpoint
|
|
31
|
-
});
|
|
32
|
-
},
|
|
33
|
-
refreshAccessToken: options.refreshAccessToken ? options.refreshAccessToken : async (refreshToken) => {
|
|
34
|
-
return refreshAccessToken({
|
|
35
|
-
refreshToken,
|
|
36
|
-
options: {
|
|
37
|
-
clientId: options.clientId,
|
|
38
|
-
clientKey: options.clientKey,
|
|
39
|
-
clientSecret: options.clientSecret
|
|
40
|
-
},
|
|
41
|
-
tokenEndpoint
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
async getUserInfo(token) {
|
|
45
|
-
if (options.getUserInfo) return options.getUserInfo(token);
|
|
46
|
-
const { data: profile, error } = await betterFetch("https://api.linear.app/graphql", {
|
|
47
|
-
method: "POST",
|
|
48
|
-
headers: {
|
|
49
|
-
"Content-Type": "application/json",
|
|
50
|
-
Authorization: `Bearer ${token.accessToken}`
|
|
51
|
-
},
|
|
52
|
-
body: JSON.stringify({ query: `
|
|
53
|
-
query {
|
|
54
|
-
viewer {
|
|
55
|
-
id
|
|
56
|
-
name
|
|
57
|
-
email
|
|
58
|
-
avatarUrl
|
|
59
|
-
active
|
|
60
|
-
createdAt
|
|
61
|
-
updatedAt
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
` })
|
|
65
|
-
});
|
|
66
|
-
if (error || !profile?.data?.viewer) return null;
|
|
67
|
-
const userData = profile.data.viewer;
|
|
68
|
-
const userMap = await options.mapProfileToUser?.(userData);
|
|
69
|
-
return {
|
|
70
|
-
user: {
|
|
71
|
-
id: profile.data.viewer.id,
|
|
72
|
-
name: profile.data.viewer.name,
|
|
73
|
-
email: profile.data.viewer.email,
|
|
74
|
-
image: profile.data.viewer.avatarUrl,
|
|
75
|
-
emailVerified: false,
|
|
76
|
-
...userMap
|
|
77
|
-
},
|
|
78
|
-
data: userData
|
|
79
|
-
};
|
|
80
|
-
},
|
|
81
|
-
options
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
//#endregion
|
|
85
|
-
export { linear };
|
package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linkedin.d.mts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { OAuth2Tokens, ProviderOptions } from "../oauth2/oauth-provider.mjs";
|
|
2
|
-
//#region src/social-providers/linkedin.d.ts
|
|
3
|
-
interface LinkedInProfile {
|
|
4
|
-
sub: string;
|
|
5
|
-
name: string;
|
|
6
|
-
given_name: string;
|
|
7
|
-
family_name: string;
|
|
8
|
-
picture: string;
|
|
9
|
-
locale: {
|
|
10
|
-
country: string;
|
|
11
|
-
language: string;
|
|
12
|
-
};
|
|
13
|
-
email: string;
|
|
14
|
-
email_verified: boolean;
|
|
15
|
-
}
|
|
16
|
-
interface LinkedInOptions extends ProviderOptions<LinkedInProfile> {
|
|
17
|
-
clientId: string;
|
|
18
|
-
}
|
|
19
|
-
declare const linkedin: (options: LinkedInOptions) => {
|
|
20
|
-
id: "linkedin";
|
|
21
|
-
name: string;
|
|
22
|
-
createAuthorizationURL: ({
|
|
23
|
-
state,
|
|
24
|
-
scopes,
|
|
25
|
-
redirectURI,
|
|
26
|
-
loginHint
|
|
27
|
-
}: {
|
|
28
|
-
state: string;
|
|
29
|
-
codeVerifier: string;
|
|
30
|
-
scopes?: string[] | undefined;
|
|
31
|
-
redirectURI: string;
|
|
32
|
-
display?: string | undefined;
|
|
33
|
-
loginHint?: string | undefined;
|
|
34
|
-
}) => Promise<URL>;
|
|
35
|
-
validateAuthorizationCode: ({
|
|
36
|
-
code,
|
|
37
|
-
redirectURI
|
|
38
|
-
}: {
|
|
39
|
-
code: string;
|
|
40
|
-
redirectURI: string;
|
|
41
|
-
codeVerifier?: string | undefined;
|
|
42
|
-
deviceId?: string | undefined;
|
|
43
|
-
}) => Promise<OAuth2Tokens>;
|
|
44
|
-
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
45
|
-
getUserInfo(token: OAuth2Tokens & {
|
|
46
|
-
user?: {
|
|
47
|
-
name?: {
|
|
48
|
-
firstName?: string;
|
|
49
|
-
lastName?: string;
|
|
50
|
-
};
|
|
51
|
-
email?: string;
|
|
52
|
-
} | undefined;
|
|
53
|
-
}): Promise<{
|
|
54
|
-
user: {
|
|
55
|
-
id: string;
|
|
56
|
-
name?: string;
|
|
57
|
-
email?: string | null;
|
|
58
|
-
image?: string;
|
|
59
|
-
emailVerified: boolean;
|
|
60
|
-
[key: string]: any;
|
|
61
|
-
};
|
|
62
|
-
data: any;
|
|
63
|
-
} | null>;
|
|
64
|
-
options: LinkedInOptions;
|
|
65
|
-
};
|
|
66
|
-
//#endregion
|
|
67
|
-
export { LinkedInOptions, LinkedInProfile, linkedin };
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
2
|
-
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
3
|
-
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
4
|
-
import { betterFetch } from "@better-fetch/fetch";
|
|
5
|
-
//#region src/social-providers/linkedin.ts
|
|
6
|
-
const linkedin = (options) => {
|
|
7
|
-
const authorizationEndpoint = "https://www.linkedin.com/oauth/v2/authorization";
|
|
8
|
-
const tokenEndpoint = "https://www.linkedin.com/oauth/v2/accessToken";
|
|
9
|
-
return {
|
|
10
|
-
id: "linkedin",
|
|
11
|
-
name: "Linkedin",
|
|
12
|
-
createAuthorizationURL: async ({ state, scopes, redirectURI, loginHint }) => {
|
|
13
|
-
const _scopes = options.disableDefaultScope ? [] : [
|
|
14
|
-
"profile",
|
|
15
|
-
"email",
|
|
16
|
-
"openid"
|
|
17
|
-
];
|
|
18
|
-
if (options.scope) _scopes.push(...options.scope);
|
|
19
|
-
if (scopes) _scopes.push(...scopes);
|
|
20
|
-
return await createAuthorizationURL({
|
|
21
|
-
id: "linkedin",
|
|
22
|
-
options,
|
|
23
|
-
authorizationEndpoint,
|
|
24
|
-
scopes: _scopes,
|
|
25
|
-
state,
|
|
26
|
-
loginHint,
|
|
27
|
-
redirectURI
|
|
28
|
-
});
|
|
29
|
-
},
|
|
30
|
-
validateAuthorizationCode: async ({ code, redirectURI }) => {
|
|
31
|
-
return await validateAuthorizationCode({
|
|
32
|
-
code,
|
|
33
|
-
redirectURI,
|
|
34
|
-
options,
|
|
35
|
-
tokenEndpoint
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
refreshAccessToken: options.refreshAccessToken ? options.refreshAccessToken : async (refreshToken) => {
|
|
39
|
-
return refreshAccessToken({
|
|
40
|
-
refreshToken,
|
|
41
|
-
options: {
|
|
42
|
-
clientId: options.clientId,
|
|
43
|
-
clientKey: options.clientKey,
|
|
44
|
-
clientSecret: options.clientSecret
|
|
45
|
-
},
|
|
46
|
-
tokenEndpoint
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
async getUserInfo(token) {
|
|
50
|
-
if (options.getUserInfo) return options.getUserInfo(token);
|
|
51
|
-
const { data: profile, error } = await betterFetch("https://api.linkedin.com/v2/userinfo", {
|
|
52
|
-
method: "GET",
|
|
53
|
-
headers: { Authorization: `Bearer ${token.accessToken}` }
|
|
54
|
-
});
|
|
55
|
-
if (error) return null;
|
|
56
|
-
const userMap = await options.mapProfileToUser?.(profile);
|
|
57
|
-
return {
|
|
58
|
-
user: {
|
|
59
|
-
id: profile.sub,
|
|
60
|
-
name: profile.name,
|
|
61
|
-
email: profile.email,
|
|
62
|
-
emailVerified: profile.email_verified || false,
|
|
63
|
-
image: profile.picture,
|
|
64
|
-
...userMap
|
|
65
|
-
},
|
|
66
|
-
data: profile
|
|
67
|
-
};
|
|
68
|
-
},
|
|
69
|
-
options
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
//#endregion
|
|
73
|
-
export { linkedin };
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { OAuth2Tokens, ProviderOptions } from "../oauth2/oauth-provider.mjs";
|
|
2
|
-
//#region src/social-providers/microsoft-entra-id.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* @see [Microsoft Identity Platform - Optional claims reference](https://learn.microsoft.com/en-us/entra/identity-platform/optional-claims-reference)
|
|
5
|
-
*/
|
|
6
|
-
interface MicrosoftEntraIDProfile extends Record<string, any> {
|
|
7
|
-
/** Identifies the intended recipient of the token */
|
|
8
|
-
aud: string;
|
|
9
|
-
/** Identifies the issuer, or "authorization server" that constructs and returns the token */
|
|
10
|
-
iss: string;
|
|
11
|
-
/** Indicates when the authentication for the token occurred */
|
|
12
|
-
iat: Date;
|
|
13
|
-
/** Records the identity provider that authenticated the subject of the token */
|
|
14
|
-
idp: string;
|
|
15
|
-
/** Identifies the time before which the JWT can't be accepted for processing */
|
|
16
|
-
nbf: Date;
|
|
17
|
-
/** Identifies the expiration time on or after which the JWT can't be accepted for processing */
|
|
18
|
-
exp: Date;
|
|
19
|
-
/** Code hash included in ID tokens when issued with an OAuth 2.0 authorization code */
|
|
20
|
-
c_hash: string;
|
|
21
|
-
/** Access token hash included in ID tokens when issued with an OAuth 2.0 access token */
|
|
22
|
-
at_hash: string;
|
|
23
|
-
/** Internal claim used to record data for token reuse */
|
|
24
|
-
aio: string;
|
|
25
|
-
/** The primary username that represents the user */
|
|
26
|
-
preferred_username: string;
|
|
27
|
-
/** User's email address */
|
|
28
|
-
email: string;
|
|
29
|
-
/** Human-readable value that identifies the subject of the token */
|
|
30
|
-
name: string;
|
|
31
|
-
/** Matches the parameter included in the original authorize request */
|
|
32
|
-
nonce: string;
|
|
33
|
-
/** User's profile picture */
|
|
34
|
-
picture: string;
|
|
35
|
-
/** Immutable identifier for the user account */
|
|
36
|
-
oid: string;
|
|
37
|
-
/** Set of roles assigned to the user */
|
|
38
|
-
roles: string[];
|
|
39
|
-
/** Internal claim used to revalidate tokens */
|
|
40
|
-
rh: string;
|
|
41
|
-
/** Subject identifier - unique to application ID */
|
|
42
|
-
sub: string;
|
|
43
|
-
/** Tenant ID the user is signing in to */
|
|
44
|
-
tid: string;
|
|
45
|
-
/** Unique identifier for a session */
|
|
46
|
-
sid: string;
|
|
47
|
-
/** Token identifier claim */
|
|
48
|
-
uti: string;
|
|
49
|
-
/** Indicates if user is in at least one group */
|
|
50
|
-
hasgroups: boolean;
|
|
51
|
-
/** User account status in tenant (0 = member, 1 = guest) */
|
|
52
|
-
acct: 0 | 1;
|
|
53
|
-
/** Auth Context IDs */
|
|
54
|
-
acrs: string;
|
|
55
|
-
/** Time when the user last authenticated */
|
|
56
|
-
auth_time: Date;
|
|
57
|
-
/** User's country/region */
|
|
58
|
-
ctry: string;
|
|
59
|
-
/** IP address of requesting client when inside VNET */
|
|
60
|
-
fwd: string;
|
|
61
|
-
/** Group claims */
|
|
62
|
-
groups: string;
|
|
63
|
-
/** Login hint for SSO */
|
|
64
|
-
login_hint: string;
|
|
65
|
-
/** Resource tenant's country/region */
|
|
66
|
-
tenant_ctry: string;
|
|
67
|
-
/** Region of the resource tenant */
|
|
68
|
-
tenant_region_scope: string;
|
|
69
|
-
/** UserPrincipalName */
|
|
70
|
-
upn: string;
|
|
71
|
-
/** User's verified primary email addresses */
|
|
72
|
-
verified_primary_email: string[];
|
|
73
|
-
/** User's verified secondary email addresses */
|
|
74
|
-
verified_secondary_email: string[];
|
|
75
|
-
/** Whether the user's email is verified (optional claim, must be configured in app registration) */
|
|
76
|
-
email_verified?: boolean | undefined;
|
|
77
|
-
/** VNET specifier information */
|
|
78
|
-
vnet: string;
|
|
79
|
-
/** Client Capabilities */
|
|
80
|
-
xms_cc: string;
|
|
81
|
-
/** Whether user's email domain is verified */
|
|
82
|
-
xms_edov: boolean;
|
|
83
|
-
/** Preferred data location for Multi-Geo tenants */
|
|
84
|
-
xms_pdl: string;
|
|
85
|
-
/** User preferred language */
|
|
86
|
-
xms_pl: string;
|
|
87
|
-
/** Tenant preferred language */
|
|
88
|
-
xms_tpl: string;
|
|
89
|
-
/** Zero-touch Deployment ID */
|
|
90
|
-
ztdid: string;
|
|
91
|
-
/** IP Address */
|
|
92
|
-
ipaddr: string;
|
|
93
|
-
/** On-premises Security Identifier */
|
|
94
|
-
onprem_sid: string;
|
|
95
|
-
/** Password Expiration Time */
|
|
96
|
-
pwd_exp: number;
|
|
97
|
-
/** Change Password URL */
|
|
98
|
-
pwd_url: string;
|
|
99
|
-
/** Inside Corporate Network flag */
|
|
100
|
-
in_corp: string;
|
|
101
|
-
/** User's family name/surname */
|
|
102
|
-
family_name: string;
|
|
103
|
-
/** User's given/first name */
|
|
104
|
-
given_name: string;
|
|
105
|
-
}
|
|
106
|
-
interface MicrosoftOptions extends ProviderOptions<MicrosoftEntraIDProfile> {
|
|
107
|
-
clientId: string | string[];
|
|
108
|
-
/**
|
|
109
|
-
* The tenant ID of the Microsoft account
|
|
110
|
-
* @default "common"
|
|
111
|
-
*/
|
|
112
|
-
tenantId?: string | undefined;
|
|
113
|
-
/**
|
|
114
|
-
* The authentication authority URL. Use the default "https://login.microsoftonline.com" for standard Entra ID or "https://<tenant-id>.ciamlogin.com" for CIAM scenarios.
|
|
115
|
-
* @default "https://login.microsoftonline.com"
|
|
116
|
-
*/
|
|
117
|
-
authority?: string | undefined;
|
|
118
|
-
/**
|
|
119
|
-
* The size of the profile photo
|
|
120
|
-
* @default 48
|
|
121
|
-
*/
|
|
122
|
-
profilePhotoSize?: (48 | 64 | 96 | 120 | 240 | 360 | 432 | 504 | 648) | undefined;
|
|
123
|
-
/**
|
|
124
|
-
* Disable profile photo
|
|
125
|
-
*/
|
|
126
|
-
disableProfilePhoto?: boolean | undefined;
|
|
127
|
-
}
|
|
128
|
-
declare const microsoft: (options: MicrosoftOptions) => {
|
|
129
|
-
id: "microsoft";
|
|
130
|
-
name: string;
|
|
131
|
-
createAuthorizationURL(data: {
|
|
132
|
-
state: string;
|
|
133
|
-
codeVerifier: string;
|
|
134
|
-
scopes?: string[] | undefined;
|
|
135
|
-
redirectURI: string;
|
|
136
|
-
display?: string | undefined;
|
|
137
|
-
loginHint?: string | undefined;
|
|
138
|
-
}): Promise<URL>;
|
|
139
|
-
validateAuthorizationCode({
|
|
140
|
-
code,
|
|
141
|
-
codeVerifier,
|
|
142
|
-
redirectURI
|
|
143
|
-
}: {
|
|
144
|
-
code: string;
|
|
145
|
-
redirectURI: string;
|
|
146
|
-
codeVerifier?: string | undefined;
|
|
147
|
-
deviceId?: string | undefined;
|
|
148
|
-
}): Promise<OAuth2Tokens>;
|
|
149
|
-
verifyIdToken(token: string, nonce: string | undefined): Promise<boolean>;
|
|
150
|
-
getUserInfo(token: OAuth2Tokens & {
|
|
151
|
-
user?: {
|
|
152
|
-
name?: {
|
|
153
|
-
firstName?: string;
|
|
154
|
-
lastName? /** The primary username that represents the user */: string;
|
|
155
|
-
};
|
|
156
|
-
email?: string;
|
|
157
|
-
} | undefined;
|
|
158
|
-
}): Promise<{
|
|
159
|
-
user: {
|
|
160
|
-
id: string;
|
|
161
|
-
name?: string;
|
|
162
|
-
email?: string | null;
|
|
163
|
-
image?: string;
|
|
164
|
-
emailVerified: boolean;
|
|
165
|
-
[key: string]: any;
|
|
166
|
-
};
|
|
167
|
-
data: any;
|
|
168
|
-
} | null>;
|
|
169
|
-
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
170
|
-
options: MicrosoftOptions;
|
|
171
|
-
};
|
|
172
|
-
declare const getMicrosoftPublicKey: (kid: string, tenant: string, authority: string) => Promise<Uint8Array<ArrayBufferLike> | CryptoKey>;
|
|
173
|
-
//#endregion
|
|
174
|
-
export { MicrosoftEntraIDProfile, MicrosoftOptions, getMicrosoftPublicKey, microsoft };
|
|
@@ -1,140 +0,0 @@
|
|
|
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 { base64 } from "@better-auth/utils/base64";
|
|
8
|
-
import { betterFetch } from "@better-fetch/fetch";
|
|
9
|
-
import { decodeJwt, decodeProtectedHeader, importJWK, jwtVerify } from "jose";
|
|
10
|
-
//#region src/social-providers/microsoft-entra-id.ts
|
|
11
|
-
const microsoft = (options) => {
|
|
12
|
-
const tenant = options.tenantId || "common";
|
|
13
|
-
const authority = options.authority || "https://login.microsoftonline.com";
|
|
14
|
-
const authorizationEndpoint = `${authority}/${tenant}/oauth2/v2.0/authorize`;
|
|
15
|
-
const tokenEndpoint = `${authority}/${tenant}/oauth2/v2.0/token`;
|
|
16
|
-
return {
|
|
17
|
-
id: "microsoft",
|
|
18
|
-
name: "Microsoft EntraID",
|
|
19
|
-
createAuthorizationURL(data) {
|
|
20
|
-
if (!getPrimaryClientId(options.clientId)) {
|
|
21
|
-
logger.error("Client Id is required for Microsoft Entra ID. Make sure to provide it in the options.");
|
|
22
|
-
throw new BetterAuthError("CLIENT_ID_AND_SECRET_REQUIRED");
|
|
23
|
-
}
|
|
24
|
-
const scopes = options.disableDefaultScope ? [] : [
|
|
25
|
-
"openid",
|
|
26
|
-
"profile",
|
|
27
|
-
"email",
|
|
28
|
-
"User.Read",
|
|
29
|
-
"offline_access"
|
|
30
|
-
];
|
|
31
|
-
if (options.scope) scopes.push(...options.scope);
|
|
32
|
-
if (data.scopes) scopes.push(...data.scopes);
|
|
33
|
-
return createAuthorizationURL({
|
|
34
|
-
id: "microsoft",
|
|
35
|
-
options,
|
|
36
|
-
authorizationEndpoint,
|
|
37
|
-
state: data.state,
|
|
38
|
-
codeVerifier: data.codeVerifier,
|
|
39
|
-
scopes,
|
|
40
|
-
redirectURI: data.redirectURI,
|
|
41
|
-
prompt: options.prompt,
|
|
42
|
-
loginHint: data.loginHint
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
validateAuthorizationCode({ code, codeVerifier, redirectURI }) {
|
|
46
|
-
return validateAuthorizationCode({
|
|
47
|
-
code,
|
|
48
|
-
codeVerifier,
|
|
49
|
-
redirectURI,
|
|
50
|
-
options,
|
|
51
|
-
tokenEndpoint
|
|
52
|
-
});
|
|
53
|
-
},
|
|
54
|
-
async verifyIdToken(token, nonce) {
|
|
55
|
-
if (options.disableIdTokenSignIn) return false;
|
|
56
|
-
if (options.verifyIdToken) return options.verifyIdToken(token, nonce);
|
|
57
|
-
try {
|
|
58
|
-
const { kid, alg: jwtAlg } = decodeProtectedHeader(token);
|
|
59
|
-
if (!kid || !jwtAlg) return false;
|
|
60
|
-
const publicKey = await getMicrosoftPublicKey(kid, tenant, authority);
|
|
61
|
-
const verifyOptions = {
|
|
62
|
-
algorithms: [jwtAlg],
|
|
63
|
-
audience: options.clientId,
|
|
64
|
-
maxTokenAge: "1h"
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Issuer varies per user's tenant for multi-tenant endpoints, so only validate for specific tenants.
|
|
68
|
-
* @see https://learn.microsoft.com/en-us/entra/identity-platform/v2-protocols#endpoints
|
|
69
|
-
*/
|
|
70
|
-
if (tenant !== "common" && tenant !== "organizations" && tenant !== "consumers") verifyOptions.issuer = `${authority}/${tenant}/v2.0`;
|
|
71
|
-
const { payload: jwtClaims } = await jwtVerify(token, publicKey, verifyOptions);
|
|
72
|
-
if (nonce && jwtClaims.nonce !== nonce) return false;
|
|
73
|
-
return true;
|
|
74
|
-
} catch (error) {
|
|
75
|
-
logger.error("Failed to verify ID token:", error);
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
async getUserInfo(token) {
|
|
80
|
-
if (options.getUserInfo) return options.getUserInfo(token);
|
|
81
|
-
if (!token.idToken) return null;
|
|
82
|
-
const user = decodeJwt(token.idToken);
|
|
83
|
-
const profilePhotoSize = options.profilePhotoSize || 48;
|
|
84
|
-
await betterFetch(`https://graph.microsoft.com/v1.0/me/photos/${profilePhotoSize}x${profilePhotoSize}/$value`, {
|
|
85
|
-
headers: { Authorization: `Bearer ${token.accessToken}` },
|
|
86
|
-
async onResponse(context) {
|
|
87
|
-
if (options.disableProfilePhoto || !context.response.ok) return;
|
|
88
|
-
try {
|
|
89
|
-
const pictureBuffer = await context.response.clone().arrayBuffer();
|
|
90
|
-
user.picture = `data:image/jpeg;base64, ${base64.encode(pictureBuffer)}`;
|
|
91
|
-
} catch (e) {
|
|
92
|
-
logger.error(e && typeof e === "object" && "name" in e ? e.name : "", e);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
const userMap = await options.mapProfileToUser?.(user);
|
|
97
|
-
const emailVerified = user.email_verified !== void 0 ? user.email_verified : user.email && (user.verified_primary_email?.includes(user.email) || user.verified_secondary_email?.includes(user.email)) ? true : false;
|
|
98
|
-
return {
|
|
99
|
-
user: {
|
|
100
|
-
id: user.sub,
|
|
101
|
-
name: user.name,
|
|
102
|
-
email: user.email,
|
|
103
|
-
image: user.picture,
|
|
104
|
-
emailVerified,
|
|
105
|
-
...userMap
|
|
106
|
-
},
|
|
107
|
-
data: user
|
|
108
|
-
};
|
|
109
|
-
},
|
|
110
|
-
refreshAccessToken: options.refreshAccessToken ? options.refreshAccessToken : async (refreshToken) => {
|
|
111
|
-
const scopes = options.disableDefaultScope ? [] : [
|
|
112
|
-
"openid",
|
|
113
|
-
"profile",
|
|
114
|
-
"email",
|
|
115
|
-
"User.Read",
|
|
116
|
-
"offline_access"
|
|
117
|
-
];
|
|
118
|
-
if (options.scope) scopes.push(...options.scope);
|
|
119
|
-
return refreshAccessToken({
|
|
120
|
-
refreshToken,
|
|
121
|
-
options: {
|
|
122
|
-
clientId: options.clientId,
|
|
123
|
-
clientSecret: options.clientSecret
|
|
124
|
-
},
|
|
125
|
-
extraParams: { scope: scopes.join(" ") },
|
|
126
|
-
tokenEndpoint
|
|
127
|
-
});
|
|
128
|
-
},
|
|
129
|
-
options
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
const getMicrosoftPublicKey = async (kid, tenant, authority) => {
|
|
133
|
-
const { data } = await betterFetch(`${authority}/${tenant}/discovery/v2.0/keys`);
|
|
134
|
-
if (!data?.keys) throw new APIError("BAD_REQUEST", { message: "Keys not found" });
|
|
135
|
-
const jwk = data.keys.find((key) => key.kid === kid);
|
|
136
|
-
if (!jwk) throw new Error(`JWK with kid ${kid} not found`);
|
|
137
|
-
return await importJWK(jwk, jwk.alg);
|
|
138
|
-
};
|
|
139
|
-
//#endregion
|
|
140
|
-
export { getMicrosoftPublicKey, microsoft };
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { OAuth2Tokens, ProviderOptions } from "../oauth2/oauth-provider.mjs";
|
|
2
|
-
//#region src/social-providers/naver.d.ts
|
|
3
|
-
interface NaverProfile {
|
|
4
|
-
/** API response result code */
|
|
5
|
-
resultcode: string;
|
|
6
|
-
/** API response message */
|
|
7
|
-
message: string;
|
|
8
|
-
response: {
|
|
9
|
-
/** Unique Naver user identifier */id: string; /** User nickname */
|
|
10
|
-
nickname: string; /** User real name */
|
|
11
|
-
name: string; /** User email address */
|
|
12
|
-
email: string; /** Gender (F: female, M: male, U: unknown) */
|
|
13
|
-
gender: string; /** Age range */
|
|
14
|
-
age: string; /** Birthday (MM-DD format) */
|
|
15
|
-
birthday: string; /** Birth year */
|
|
16
|
-
birthyear: string; /** Profile image URL */
|
|
17
|
-
profile_image: string; /** Mobile phone number */
|
|
18
|
-
mobile: string;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
interface NaverOptions extends ProviderOptions<NaverProfile> {
|
|
22
|
-
clientId: string;
|
|
23
|
-
}
|
|
24
|
-
declare const naver: (options: NaverOptions) => {
|
|
25
|
-
id: "naver";
|
|
26
|
-
name: string;
|
|
27
|
-
createAuthorizationURL({
|
|
28
|
-
state,
|
|
29
|
-
scopes,
|
|
30
|
-
redirectURI
|
|
31
|
-
}: {
|
|
32
|
-
state: string;
|
|
33
|
-
codeVerifier: string;
|
|
34
|
-
scopes?: string[] | undefined;
|
|
35
|
-
redirectURI: string;
|
|
36
|
-
display?: string | undefined;
|
|
37
|
-
loginHint?: string | undefined;
|
|
38
|
-
}): Promise<URL>;
|
|
39
|
-
validateAuthorizationCode: ({
|
|
40
|
-
code,
|
|
41
|
-
redirectURI
|
|
42
|
-
}: {
|
|
43
|
-
code: string;
|
|
44
|
-
redirectURI: string;
|
|
45
|
-
codeVerifier?: string | undefined;
|
|
46
|
-
deviceId?: string | undefined;
|
|
47
|
-
}) => Promise<OAuth2Tokens>;
|
|
48
|
-
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
49
|
-
getUserInfo(token: OAuth2Tokens & {
|
|
50
|
-
user?: {
|
|
51
|
-
name?: {
|
|
52
|
-
firstName?: string;
|
|
53
|
-
lastName?: string;
|
|
54
|
-
};
|
|
55
|
-
email?: string;
|
|
56
|
-
} | undefined;
|
|
57
|
-
}): Promise<{
|
|
58
|
-
user: {
|
|
59
|
-
id: string;
|
|
60
|
-
name?: string;
|
|
61
|
-
email?: string | null;
|
|
62
|
-
image?: string;
|
|
63
|
-
emailVerified: boolean;
|
|
64
|
-
[key: string]: any;
|
|
65
|
-
};
|
|
66
|
-
data: any;
|
|
67
|
-
} | {
|
|
68
|
-
user: {
|
|
69
|
-
id: string;
|
|
70
|
-
name: string;
|
|
71
|
-
email: string;
|
|
72
|
-
image: string;
|
|
73
|
-
emailVerified: boolean;
|
|
74
|
-
} | {
|
|
75
|
-
id: string;
|
|
76
|
-
name: string;
|
|
77
|
-
email: string | null;
|
|
78
|
-
image: string;
|
|
79
|
-
emailVerified: boolean;
|
|
80
|
-
} | {
|
|
81
|
-
id: string;
|
|
82
|
-
name: string;
|
|
83
|
-
email: string | null;
|
|
84
|
-
image: string;
|
|
85
|
-
emailVerified: boolean;
|
|
86
|
-
};
|
|
87
|
-
data: NaverProfile;
|
|
88
|
-
} | null>;
|
|
89
|
-
options: NaverOptions;
|
|
90
|
-
};
|
|
91
|
-
//#endregion
|
|
92
|
-
export { NaverOptions, NaverProfile, naver };
|