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,83 +0,0 @@
|
|
|
1
|
-
import { OAuth2Tokens, ProviderOptions } from "../oauth2/oauth-provider.mjs";
|
|
2
|
-
//#region src/social-providers/slack.d.ts
|
|
3
|
-
interface SlackProfile extends Record<string, any> {
|
|
4
|
-
ok: boolean;
|
|
5
|
-
sub: string;
|
|
6
|
-
"https://slack.com/user_id": string;
|
|
7
|
-
"https://slack.com/team_id": string;
|
|
8
|
-
email: string;
|
|
9
|
-
email_verified: boolean;
|
|
10
|
-
date_email_verified: number;
|
|
11
|
-
name: string;
|
|
12
|
-
picture: string;
|
|
13
|
-
given_name: string;
|
|
14
|
-
family_name: string;
|
|
15
|
-
locale: string;
|
|
16
|
-
"https://slack.com/team_name": string;
|
|
17
|
-
"https://slack.com/team_domain": string;
|
|
18
|
-
"https://slack.com/user_image_24": string;
|
|
19
|
-
"https://slack.com/user_image_32": string;
|
|
20
|
-
"https://slack.com/user_image_48": string;
|
|
21
|
-
"https://slack.com/user_image_72": string;
|
|
22
|
-
"https://slack.com/user_image_192": string;
|
|
23
|
-
"https://slack.com/user_image_512": string;
|
|
24
|
-
"https://slack.com/team_image_34": string;
|
|
25
|
-
"https://slack.com/team_image_44": string;
|
|
26
|
-
"https://slack.com/team_image_68": string;
|
|
27
|
-
"https://slack.com/team_image_88": string;
|
|
28
|
-
"https://slack.com/team_image_102": string;
|
|
29
|
-
"https://slack.com/team_image_132": string;
|
|
30
|
-
"https://slack.com/team_image_230": string;
|
|
31
|
-
"https://slack.com/team_image_default": boolean;
|
|
32
|
-
}
|
|
33
|
-
interface SlackOptions extends ProviderOptions<SlackProfile> {
|
|
34
|
-
clientId: string;
|
|
35
|
-
}
|
|
36
|
-
declare const slack: (options: SlackOptions) => {
|
|
37
|
-
id: "slack";
|
|
38
|
-
name: string;
|
|
39
|
-
createAuthorizationURL({
|
|
40
|
-
state,
|
|
41
|
-
scopes,
|
|
42
|
-
redirectURI
|
|
43
|
-
}: {
|
|
44
|
-
state: string;
|
|
45
|
-
codeVerifier: string;
|
|
46
|
-
scopes?: string[] | undefined;
|
|
47
|
-
redirectURI: string;
|
|
48
|
-
display?: string | undefined;
|
|
49
|
-
loginHint?: string | undefined;
|
|
50
|
-
}): URL;
|
|
51
|
-
validateAuthorizationCode: ({
|
|
52
|
-
code,
|
|
53
|
-
redirectURI
|
|
54
|
-
}: {
|
|
55
|
-
code: string;
|
|
56
|
-
redirectURI: string;
|
|
57
|
-
codeVerifier?: string | undefined;
|
|
58
|
-
deviceId?: string | undefined;
|
|
59
|
-
}) => Promise<OAuth2Tokens>;
|
|
60
|
-
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
61
|
-
getUserInfo(token: OAuth2Tokens & {
|
|
62
|
-
user?: {
|
|
63
|
-
name?: {
|
|
64
|
-
firstName?: string;
|
|
65
|
-
lastName?: string;
|
|
66
|
-
};
|
|
67
|
-
email?: string;
|
|
68
|
-
} | undefined;
|
|
69
|
-
}): Promise<{
|
|
70
|
-
user: {
|
|
71
|
-
id: string;
|
|
72
|
-
name?: string;
|
|
73
|
-
email?: string | null;
|
|
74
|
-
image?: string;
|
|
75
|
-
emailVerified: boolean;
|
|
76
|
-
[key: string]: any;
|
|
77
|
-
};
|
|
78
|
-
data: any;
|
|
79
|
-
} | null>;
|
|
80
|
-
options: SlackOptions;
|
|
81
|
-
};
|
|
82
|
-
//#endregion
|
|
83
|
-
export { SlackOptions, SlackProfile, slack };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
2
|
-
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
3
|
-
import { betterFetch } from "@better-fetch/fetch";
|
|
4
|
-
//#region src/social-providers/slack.ts
|
|
5
|
-
const slack = (options) => {
|
|
6
|
-
const tokenEndpoint = "https://slack.com/api/openid.connect.token";
|
|
7
|
-
return {
|
|
8
|
-
id: "slack",
|
|
9
|
-
name: "Slack",
|
|
10
|
-
createAuthorizationURL({ state, scopes, redirectURI }) {
|
|
11
|
-
const _scopes = options.disableDefaultScope ? [] : [
|
|
12
|
-
"openid",
|
|
13
|
-
"profile",
|
|
14
|
-
"email"
|
|
15
|
-
];
|
|
16
|
-
if (scopes) _scopes.push(...scopes);
|
|
17
|
-
if (options.scope) _scopes.push(...options.scope);
|
|
18
|
-
const url = new URL("https://slack.com/openid/connect/authorize");
|
|
19
|
-
url.searchParams.set("scope", _scopes.join(" "));
|
|
20
|
-
url.searchParams.set("response_type", "code");
|
|
21
|
-
url.searchParams.set("client_id", options.clientId);
|
|
22
|
-
url.searchParams.set("redirect_uri", options.redirectURI || redirectURI);
|
|
23
|
-
url.searchParams.set("state", state);
|
|
24
|
-
return url;
|
|
25
|
-
},
|
|
26
|
-
validateAuthorizationCode: async ({ code, redirectURI }) => {
|
|
27
|
-
return validateAuthorizationCode({
|
|
28
|
-
code,
|
|
29
|
-
redirectURI,
|
|
30
|
-
options,
|
|
31
|
-
tokenEndpoint
|
|
32
|
-
});
|
|
33
|
-
},
|
|
34
|
-
refreshAccessToken: options.refreshAccessToken ? options.refreshAccessToken : async (refreshToken) => {
|
|
35
|
-
return refreshAccessToken({
|
|
36
|
-
refreshToken,
|
|
37
|
-
options: {
|
|
38
|
-
clientId: options.clientId,
|
|
39
|
-
clientKey: options.clientKey,
|
|
40
|
-
clientSecret: options.clientSecret
|
|
41
|
-
},
|
|
42
|
-
tokenEndpoint
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
async getUserInfo(token) {
|
|
46
|
-
if (options.getUserInfo) return options.getUserInfo(token);
|
|
47
|
-
const { data: profile, error } = await betterFetch("https://slack.com/api/openid.connect.userInfo", { headers: { authorization: `Bearer ${token.accessToken}` } });
|
|
48
|
-
if (error) return null;
|
|
49
|
-
const userMap = await options.mapProfileToUser?.(profile);
|
|
50
|
-
return {
|
|
51
|
-
user: {
|
|
52
|
-
id: profile["https://slack.com/user_id"],
|
|
53
|
-
name: profile.name || "",
|
|
54
|
-
email: profile.email,
|
|
55
|
-
emailVerified: profile.email_verified,
|
|
56
|
-
image: profile.picture || profile["https://slack.com/user_image_512"],
|
|
57
|
-
...userMap
|
|
58
|
-
},
|
|
59
|
-
data: profile
|
|
60
|
-
};
|
|
61
|
-
},
|
|
62
|
-
options
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
//#endregion
|
|
66
|
-
export { slack };
|
package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/spotify.d.mts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { OAuth2Tokens, ProviderOptions } from "../oauth2/oauth-provider.mjs";
|
|
2
|
-
//#region src/social-providers/spotify.d.ts
|
|
3
|
-
interface SpotifyProfile {
|
|
4
|
-
id: string;
|
|
5
|
-
display_name: string;
|
|
6
|
-
email: string;
|
|
7
|
-
images: {
|
|
8
|
-
url: string;
|
|
9
|
-
}[];
|
|
10
|
-
}
|
|
11
|
-
interface SpotifyOptions extends ProviderOptions<SpotifyProfile> {
|
|
12
|
-
clientId: string;
|
|
13
|
-
}
|
|
14
|
-
declare const spotify: (options: SpotifyOptions) => {
|
|
15
|
-
id: "spotify";
|
|
16
|
-
name: string;
|
|
17
|
-
createAuthorizationURL({
|
|
18
|
-
state,
|
|
19
|
-
scopes,
|
|
20
|
-
codeVerifier,
|
|
21
|
-
redirectURI
|
|
22
|
-
}: {
|
|
23
|
-
state: string;
|
|
24
|
-
codeVerifier: string;
|
|
25
|
-
scopes?: string[] | undefined;
|
|
26
|
-
redirectURI: string;
|
|
27
|
-
display?: string | undefined;
|
|
28
|
-
loginHint?: string | undefined;
|
|
29
|
-
}): Promise<URL>;
|
|
30
|
-
validateAuthorizationCode: ({
|
|
31
|
-
code,
|
|
32
|
-
codeVerifier,
|
|
33
|
-
redirectURI
|
|
34
|
-
}: {
|
|
35
|
-
code: string;
|
|
36
|
-
redirectURI: string;
|
|
37
|
-
codeVerifier?: string | undefined;
|
|
38
|
-
deviceId?: string | undefined;
|
|
39
|
-
}) => Promise<OAuth2Tokens>;
|
|
40
|
-
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
41
|
-
getUserInfo(token: OAuth2Tokens & {
|
|
42
|
-
user?: {
|
|
43
|
-
name?: {
|
|
44
|
-
firstName?: string;
|
|
45
|
-
lastName?: string;
|
|
46
|
-
};
|
|
47
|
-
email?: string;
|
|
48
|
-
} | undefined;
|
|
49
|
-
}): Promise<{
|
|
50
|
-
user: {
|
|
51
|
-
id: string;
|
|
52
|
-
name?: string;
|
|
53
|
-
email?: string | null;
|
|
54
|
-
image?: string;
|
|
55
|
-
emailVerified: boolean;
|
|
56
|
-
[key: string]: any;
|
|
57
|
-
};
|
|
58
|
-
data: any;
|
|
59
|
-
} | null>;
|
|
60
|
-
options: SpotifyOptions;
|
|
61
|
-
};
|
|
62
|
-
//#endregion
|
|
63
|
-
export { SpotifyOptions, SpotifyProfile, spotify };
|
|
@@ -1,69 +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/spotify.ts
|
|
6
|
-
const spotify = (options) => {
|
|
7
|
-
const tokenEndpoint = "https://accounts.spotify.com/api/token";
|
|
8
|
-
return {
|
|
9
|
-
id: "spotify",
|
|
10
|
-
name: "Spotify",
|
|
11
|
-
createAuthorizationURL({ state, scopes, codeVerifier, redirectURI }) {
|
|
12
|
-
const _scopes = options.disableDefaultScope ? [] : ["user-read-email"];
|
|
13
|
-
if (options.scope) _scopes.push(...options.scope);
|
|
14
|
-
if (scopes) _scopes.push(...scopes);
|
|
15
|
-
return createAuthorizationURL({
|
|
16
|
-
id: "spotify",
|
|
17
|
-
options,
|
|
18
|
-
authorizationEndpoint: "https://accounts.spotify.com/authorize",
|
|
19
|
-
scopes: _scopes,
|
|
20
|
-
state,
|
|
21
|
-
codeVerifier,
|
|
22
|
-
redirectURI
|
|
23
|
-
});
|
|
24
|
-
},
|
|
25
|
-
validateAuthorizationCode: async ({ code, codeVerifier, redirectURI }) => {
|
|
26
|
-
return validateAuthorizationCode({
|
|
27
|
-
code,
|
|
28
|
-
codeVerifier,
|
|
29
|
-
redirectURI,
|
|
30
|
-
options,
|
|
31
|
-
tokenEndpoint
|
|
32
|
-
});
|
|
33
|
-
},
|
|
34
|
-
refreshAccessToken: options.refreshAccessToken ? options.refreshAccessToken : async (refreshToken) => {
|
|
35
|
-
return refreshAccessToken({
|
|
36
|
-
refreshToken,
|
|
37
|
-
options: {
|
|
38
|
-
clientId: options.clientId,
|
|
39
|
-
clientKey: options.clientKey,
|
|
40
|
-
clientSecret: options.clientSecret
|
|
41
|
-
},
|
|
42
|
-
tokenEndpoint
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
async getUserInfo(token) {
|
|
46
|
-
if (options.getUserInfo) return options.getUserInfo(token);
|
|
47
|
-
const { data: profile, error } = await betterFetch("https://api.spotify.com/v1/me", {
|
|
48
|
-
method: "GET",
|
|
49
|
-
headers: { Authorization: `Bearer ${token.accessToken}` }
|
|
50
|
-
});
|
|
51
|
-
if (error) return null;
|
|
52
|
-
const userMap = await options.mapProfileToUser?.(profile);
|
|
53
|
-
return {
|
|
54
|
-
user: {
|
|
55
|
-
id: profile.id,
|
|
56
|
-
name: profile.display_name,
|
|
57
|
-
email: profile.email,
|
|
58
|
-
image: profile.images[0]?.url,
|
|
59
|
-
emailVerified: false,
|
|
60
|
-
...userMap
|
|
61
|
-
},
|
|
62
|
-
data: profile
|
|
63
|
-
};
|
|
64
|
-
},
|
|
65
|
-
options
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
//#endregion
|
|
69
|
-
export { spotify };
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { OAuth2Tokens, ProviderOptions } from "../oauth2/oauth-provider.mjs";
|
|
2
|
-
//#region src/social-providers/tiktok.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* [More info](https://developers.tiktok.com/doc/tiktok-api-v2-get-user-info/)
|
|
5
|
-
*/
|
|
6
|
-
interface TiktokProfile extends Record<string, any> {
|
|
7
|
-
data: {
|
|
8
|
-
user: {
|
|
9
|
-
/**
|
|
10
|
-
* The unique identification of the user in the current application.Open id
|
|
11
|
-
* for the client.
|
|
12
|
-
*
|
|
13
|
-
* To return this field, add `fields=open_id` in the user profile request's query parameter.
|
|
14
|
-
*/
|
|
15
|
-
open_id: string;
|
|
16
|
-
/**
|
|
17
|
-
* The unique identification of the user across different apps for the same developer.
|
|
18
|
-
* For example, if a partner has X number of clients,
|
|
19
|
-
* it will get X number of open_id for the same TikTok user,
|
|
20
|
-
* but one persistent union_id for the particular user.
|
|
21
|
-
*
|
|
22
|
-
* To return this field, add `fields=union_id` in the user profile request's query parameter.
|
|
23
|
-
*/
|
|
24
|
-
union_id?: string | undefined;
|
|
25
|
-
/**
|
|
26
|
-
* User's profile image.
|
|
27
|
-
*
|
|
28
|
-
* To return this field, add `fields=avatar_url` in the user profile request's query parameter.
|
|
29
|
-
*/
|
|
30
|
-
avatar_url?: string | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* User`s profile image in 100x100 size.
|
|
33
|
-
*
|
|
34
|
-
* To return this field, add `fields=avatar_url_100` in the user profile request's query parameter.
|
|
35
|
-
*/
|
|
36
|
-
avatar_url_100?: string | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* User's profile image with higher resolution
|
|
39
|
-
*
|
|
40
|
-
* To return this field, add `fields=avatar_url_100` in the user profile request's query parameter.
|
|
41
|
-
*/
|
|
42
|
-
avatar_large_url: string;
|
|
43
|
-
/**
|
|
44
|
-
* User's profile name
|
|
45
|
-
*
|
|
46
|
-
* To return this field, add `fields=display_name` in the user profile request's query parameter.
|
|
47
|
-
*/
|
|
48
|
-
display_name: string;
|
|
49
|
-
/**
|
|
50
|
-
* User's username.
|
|
51
|
-
*
|
|
52
|
-
* To return this field, add `fields=username` in the user profile request's query parameter.
|
|
53
|
-
*/
|
|
54
|
-
username: string; /** @note Email is currently unsupported by TikTok */
|
|
55
|
-
email?: string | undefined;
|
|
56
|
-
/**
|
|
57
|
-
* User's bio description if there is a valid one.
|
|
58
|
-
*
|
|
59
|
-
* To return this field, add `fields=bio_description` in the user profile request's query parameter.
|
|
60
|
-
*/
|
|
61
|
-
bio_description?: string | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* The link to user's TikTok profile page.
|
|
64
|
-
*
|
|
65
|
-
* To return this field, add `fields=profile_deep_link` in the user profile request's query parameter.
|
|
66
|
-
*/
|
|
67
|
-
profile_deep_link?: string | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* Whether TikTok has provided a verified badge to the account after confirming
|
|
70
|
-
* that it belongs to the user it represents.
|
|
71
|
-
*
|
|
72
|
-
* To return this field, add `fields=is_verified` in the user profile request's query parameter.
|
|
73
|
-
*/
|
|
74
|
-
is_verified?: boolean | undefined;
|
|
75
|
-
/**
|
|
76
|
-
* User's followers count.
|
|
77
|
-
*
|
|
78
|
-
* To return this field, add `fields=follower_count` in the user profile request's query parameter.
|
|
79
|
-
*/
|
|
80
|
-
follower_count?: number | undefined;
|
|
81
|
-
/**
|
|
82
|
-
* The number of accounts that the user is following.
|
|
83
|
-
*
|
|
84
|
-
* To return this field, add `fields=following_count` in the user profile request's query parameter.
|
|
85
|
-
*/
|
|
86
|
-
following_count?: number | undefined;
|
|
87
|
-
/**
|
|
88
|
-
* The total number of likes received by the user across all of their videos.
|
|
89
|
-
*
|
|
90
|
-
* To return this field, add `fields=likes_count` in the user profile request's query parameter.
|
|
91
|
-
*/
|
|
92
|
-
likes_count?: number | undefined;
|
|
93
|
-
/**
|
|
94
|
-
* The total number of publicly posted videos by the user.
|
|
95
|
-
*
|
|
96
|
-
* To return this field, add `fields=video_count` in the user profile request's query parameter.
|
|
97
|
-
*/
|
|
98
|
-
video_count?: number | undefined;
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
error?: {
|
|
102
|
-
/**
|
|
103
|
-
* The error category in string.
|
|
104
|
-
*/
|
|
105
|
-
code?: string;
|
|
106
|
-
/**
|
|
107
|
-
* The error message in string.
|
|
108
|
-
*/
|
|
109
|
-
message?: string;
|
|
110
|
-
/**
|
|
111
|
-
* The error message in string.
|
|
112
|
-
*/
|
|
113
|
-
log_id?: string;
|
|
114
|
-
} | undefined;
|
|
115
|
-
}
|
|
116
|
-
interface TiktokOptions extends ProviderOptions {
|
|
117
|
-
clientId?: never | undefined;
|
|
118
|
-
clientSecret: string;
|
|
119
|
-
clientKey: string;
|
|
120
|
-
}
|
|
121
|
-
declare const tiktok: (options: TiktokOptions) => {
|
|
122
|
-
id: "tiktok";
|
|
123
|
-
name: string;
|
|
124
|
-
createAuthorizationURL({
|
|
125
|
-
state,
|
|
126
|
-
scopes,
|
|
127
|
-
redirectURI
|
|
128
|
-
}: {
|
|
129
|
-
state: string;
|
|
130
|
-
codeVerifier: string;
|
|
131
|
-
scopes?: string[] | undefined;
|
|
132
|
-
redirectURI: string;
|
|
133
|
-
display?: string | undefined;
|
|
134
|
-
loginHint?: string | undefined;
|
|
135
|
-
}): URL;
|
|
136
|
-
validateAuthorizationCode: ({
|
|
137
|
-
code,
|
|
138
|
-
redirectURI
|
|
139
|
-
}: {
|
|
140
|
-
code: string;
|
|
141
|
-
redirectURI: string;
|
|
142
|
-
codeVerifier?: string | undefined;
|
|
143
|
-
deviceId?: string | undefined;
|
|
144
|
-
}) => Promise<OAuth2Tokens>;
|
|
145
|
-
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
146
|
-
getUserInfo(token: OAuth2Tokens & {
|
|
147
|
-
user?: {
|
|
148
|
-
name?: {
|
|
149
|
-
firstName?: string;
|
|
150
|
-
lastName?: string;
|
|
151
|
-
};
|
|
152
|
-
email?: string;
|
|
153
|
-
} | undefined;
|
|
154
|
-
}): Promise<{
|
|
155
|
-
user: {
|
|
156
|
-
id: string;
|
|
157
|
-
name?: string;
|
|
158
|
-
email?: string | null;
|
|
159
|
-
image?: string;
|
|
160
|
-
emailVerified: boolean;
|
|
161
|
-
[key: string]: any;
|
|
162
|
-
};
|
|
163
|
-
data: any;
|
|
164
|
-
} | null>;
|
|
165
|
-
options: TiktokOptions;
|
|
166
|
-
};
|
|
167
|
-
//#endregion
|
|
168
|
-
export { TiktokOptions, TiktokProfile, tiktok };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
2
|
-
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
3
|
-
import { betterFetch } from "@better-fetch/fetch";
|
|
4
|
-
//#region src/social-providers/tiktok.ts
|
|
5
|
-
const tiktok = (options) => {
|
|
6
|
-
const tokenEndpoint = "https://open.tiktokapis.com/v2/oauth/token/";
|
|
7
|
-
return {
|
|
8
|
-
id: "tiktok",
|
|
9
|
-
name: "TikTok",
|
|
10
|
-
createAuthorizationURL({ state, scopes, redirectURI }) {
|
|
11
|
-
const _scopes = options.disableDefaultScope ? [] : ["user.info.profile"];
|
|
12
|
-
if (options.scope) _scopes.push(...options.scope);
|
|
13
|
-
if (scopes) _scopes.push(...scopes);
|
|
14
|
-
return new URL(`https://www.tiktok.com/v2/auth/authorize?scope=${_scopes.join(",")}&response_type=code&client_key=${options.clientKey}&redirect_uri=${encodeURIComponent(options.redirectURI || redirectURI)}&state=${state}`);
|
|
15
|
-
},
|
|
16
|
-
validateAuthorizationCode: async ({ code, redirectURI }) => {
|
|
17
|
-
return validateAuthorizationCode({
|
|
18
|
-
code,
|
|
19
|
-
redirectURI: options.redirectURI || redirectURI,
|
|
20
|
-
options: {
|
|
21
|
-
clientKey: options.clientKey,
|
|
22
|
-
clientSecret: options.clientSecret
|
|
23
|
-
},
|
|
24
|
-
tokenEndpoint
|
|
25
|
-
});
|
|
26
|
-
},
|
|
27
|
-
refreshAccessToken: options.refreshAccessToken ? options.refreshAccessToken : async (refreshToken) => {
|
|
28
|
-
return refreshAccessToken({
|
|
29
|
-
refreshToken,
|
|
30
|
-
options: { clientSecret: options.clientSecret },
|
|
31
|
-
tokenEndpoint,
|
|
32
|
-
authentication: "post",
|
|
33
|
-
extraParams: { client_key: options.clientKey }
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
async getUserInfo(token) {
|
|
37
|
-
if (options.getUserInfo) return options.getUserInfo(token);
|
|
38
|
-
const { data: profile, error } = await betterFetch(`https://open.tiktokapis.com/v2/user/info/?fields=${[
|
|
39
|
-
"open_id",
|
|
40
|
-
"avatar_large_url",
|
|
41
|
-
"display_name",
|
|
42
|
-
"username"
|
|
43
|
-
].join(",")}`, { headers: { authorization: `Bearer ${token.accessToken}` } });
|
|
44
|
-
if (error) return null;
|
|
45
|
-
return {
|
|
46
|
-
user: {
|
|
47
|
-
email: profile.data.user.email || profile.data.user.username,
|
|
48
|
-
id: profile.data.user.open_id,
|
|
49
|
-
name: profile.data.user.display_name || profile.data.user.username || "",
|
|
50
|
-
image: profile.data.user.avatar_large_url,
|
|
51
|
-
emailVerified: false
|
|
52
|
-
},
|
|
53
|
-
data: profile
|
|
54
|
-
};
|
|
55
|
-
},
|
|
56
|
-
options
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
//#endregion
|
|
60
|
-
export { tiktok };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { OAuth2Tokens, ProviderOptions } from "../oauth2/oauth-provider.mjs";
|
|
2
|
-
//#region src/social-providers/twitch.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* @see https://dev.twitch.tv/docs/authentication/getting-tokens-oidc/#requesting-claims
|
|
5
|
-
*/
|
|
6
|
-
interface TwitchProfile {
|
|
7
|
-
/**
|
|
8
|
-
* The sub of the user
|
|
9
|
-
*/
|
|
10
|
-
sub: string;
|
|
11
|
-
/**
|
|
12
|
-
* The preferred username of the user
|
|
13
|
-
*/
|
|
14
|
-
preferred_username: string;
|
|
15
|
-
/**
|
|
16
|
-
* The email of the user
|
|
17
|
-
*/
|
|
18
|
-
email: string;
|
|
19
|
-
/**
|
|
20
|
-
* Indicate if this user has a verified email.
|
|
21
|
-
*/
|
|
22
|
-
email_verified: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* The picture of the user
|
|
25
|
-
*/
|
|
26
|
-
picture: string;
|
|
27
|
-
}
|
|
28
|
-
interface TwitchOptions extends ProviderOptions<TwitchProfile> {
|
|
29
|
-
clientId: string;
|
|
30
|
-
claims?: string[] | undefined;
|
|
31
|
-
}
|
|
32
|
-
declare const twitch: (options: TwitchOptions) => {
|
|
33
|
-
id: "twitch";
|
|
34
|
-
name: string;
|
|
35
|
-
createAuthorizationURL({
|
|
36
|
-
state,
|
|
37
|
-
scopes,
|
|
38
|
-
redirectURI
|
|
39
|
-
}: {
|
|
40
|
-
state: string;
|
|
41
|
-
codeVerifier: string;
|
|
42
|
-
scopes?: string[] | undefined;
|
|
43
|
-
redirectURI: string;
|
|
44
|
-
display?: string | undefined;
|
|
45
|
-
loginHint?: string | undefined;
|
|
46
|
-
}): Promise<URL>;
|
|
47
|
-
validateAuthorizationCode: ({
|
|
48
|
-
code,
|
|
49
|
-
redirectURI
|
|
50
|
-
}: {
|
|
51
|
-
code: string;
|
|
52
|
-
redirectURI: string;
|
|
53
|
-
codeVerifier?: string | undefined;
|
|
54
|
-
deviceId?: string | undefined;
|
|
55
|
-
}) => Promise<OAuth2Tokens>;
|
|
56
|
-
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
57
|
-
getUserInfo(token: OAuth2Tokens & {
|
|
58
|
-
user?: {
|
|
59
|
-
name?: {
|
|
60
|
-
firstName?: string;
|
|
61
|
-
lastName?: string;
|
|
62
|
-
};
|
|
63
|
-
email?: string;
|
|
64
|
-
} | undefined;
|
|
65
|
-
}): Promise<{
|
|
66
|
-
user: {
|
|
67
|
-
id: string;
|
|
68
|
-
name?: string;
|
|
69
|
-
email?: string | null;
|
|
70
|
-
image?: string;
|
|
71
|
-
emailVerified: boolean;
|
|
72
|
-
[key: string]: any;
|
|
73
|
-
};
|
|
74
|
-
data: any;
|
|
75
|
-
} | null>;
|
|
76
|
-
options: TwitchOptions;
|
|
77
|
-
};
|
|
78
|
-
//#endregion
|
|
79
|
-
export { TwitchOptions, TwitchProfile, twitch };
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { logger } from "../env/logger.mjs";
|
|
2
|
-
import { createAuthorizationURL } from "../oauth2/create-authorization-url.mjs";
|
|
3
|
-
import { refreshAccessToken } from "../oauth2/refresh-access-token.mjs";
|
|
4
|
-
import { validateAuthorizationCode } from "../oauth2/validate-authorization-code.mjs";
|
|
5
|
-
import { decodeJwt } from "jose";
|
|
6
|
-
//#region src/social-providers/twitch.ts
|
|
7
|
-
const twitch = (options) => {
|
|
8
|
-
const tokenEndpoint = "https://id.twitch.tv/oauth2/token";
|
|
9
|
-
return {
|
|
10
|
-
id: "twitch",
|
|
11
|
-
name: "Twitch",
|
|
12
|
-
createAuthorizationURL({ state, scopes, redirectURI }) {
|
|
13
|
-
const _scopes = options.disableDefaultScope ? [] : ["user:read:email", "openid"];
|
|
14
|
-
if (options.scope) _scopes.push(...options.scope);
|
|
15
|
-
if (scopes) _scopes.push(...scopes);
|
|
16
|
-
return createAuthorizationURL({
|
|
17
|
-
id: "twitch",
|
|
18
|
-
redirectURI,
|
|
19
|
-
options,
|
|
20
|
-
authorizationEndpoint: "https://id.twitch.tv/oauth2/authorize",
|
|
21
|
-
scopes: _scopes,
|
|
22
|
-
state,
|
|
23
|
-
claims: options.claims || [
|
|
24
|
-
"email",
|
|
25
|
-
"email_verified",
|
|
26
|
-
"preferred_username",
|
|
27
|
-
"picture"
|
|
28
|
-
]
|
|
29
|
-
});
|
|
30
|
-
},
|
|
31
|
-
validateAuthorizationCode: async ({ code, redirectURI }) => {
|
|
32
|
-
return validateAuthorizationCode({
|
|
33
|
-
code,
|
|
34
|
-
redirectURI,
|
|
35
|
-
options,
|
|
36
|
-
tokenEndpoint
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
refreshAccessToken: options.refreshAccessToken ? options.refreshAccessToken : async (refreshToken) => {
|
|
40
|
-
return refreshAccessToken({
|
|
41
|
-
refreshToken,
|
|
42
|
-
options: {
|
|
43
|
-
clientId: options.clientId,
|
|
44
|
-
clientKey: options.clientKey,
|
|
45
|
-
clientSecret: options.clientSecret
|
|
46
|
-
},
|
|
47
|
-
tokenEndpoint
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
async getUserInfo(token) {
|
|
51
|
-
if (options.getUserInfo) return options.getUserInfo(token);
|
|
52
|
-
const idToken = token.idToken;
|
|
53
|
-
if (!idToken) {
|
|
54
|
-
logger.error("No idToken found in token");
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
const profile = decodeJwt(idToken);
|
|
58
|
-
const userMap = await options.mapProfileToUser?.(profile);
|
|
59
|
-
return {
|
|
60
|
-
user: {
|
|
61
|
-
id: profile.sub,
|
|
62
|
-
name: profile.preferred_username,
|
|
63
|
-
email: profile.email,
|
|
64
|
-
image: profile.picture,
|
|
65
|
-
emailVerified: profile.email_verified,
|
|
66
|
-
...userMap
|
|
67
|
-
},
|
|
68
|
-
data: profile
|
|
69
|
-
};
|
|
70
|
-
},
|
|
71
|
-
options
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
//#endregion
|
|
75
|
-
export { twitch };
|