@mulverse/mulguard-core 1.0.0
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/README.md +24 -0
- package/adapters.d.ts +522 -0
- package/adapters.d.ts.map +1 -0
- package/adapters.js +170 -0
- package/errors.d.ts +429 -0
- package/errors.d.ts.map +1 -0
- package/errors.js +473 -0
- package/index.d.ts +547 -0
- package/index.d.ts.map +1 -0
- package/index.js +142 -0
- package/jwt.d.ts +132 -0
- package/jwt.d.ts.map +1 -0
- package/jwt.js +123 -0
- package/lib/actions/callback/handle-login.d.ts +35 -0
- package/lib/actions/callback/handle-login.d.ts.map +1 -0
- package/lib/actions/callback/handle-login.js +275 -0
- package/lib/actions/callback/index.d.ts +5 -0
- package/lib/actions/callback/index.d.ts.map +1 -0
- package/lib/actions/callback/index.js +409 -0
- package/lib/actions/callback/oauth/callback.d.ts +36 -0
- package/lib/actions/callback/oauth/callback.d.ts.map +1 -0
- package/lib/actions/callback/oauth/callback.js +248 -0
- package/lib/actions/callback/oauth/checks.d.ts +70 -0
- package/lib/actions/callback/oauth/checks.d.ts.map +1 -0
- package/lib/actions/callback/oauth/checks.js +188 -0
- package/lib/actions/callback/oauth/csrf-token.d.ts +33 -0
- package/lib/actions/callback/oauth/csrf-token.d.ts.map +1 -0
- package/lib/actions/callback/oauth/csrf-token.js +39 -0
- package/lib/actions/index.d.ts +6 -0
- package/lib/actions/index.d.ts.map +1 -0
- package/lib/actions/index.js +5 -0
- package/lib/actions/session.d.ts +5 -0
- package/lib/actions/session.d.ts.map +1 -0
- package/lib/actions/session.js +127 -0
- package/lib/actions/signin/authorization-url.d.ts +12 -0
- package/lib/actions/signin/authorization-url.d.ts.map +1 -0
- package/lib/actions/signin/authorization-url.js +94 -0
- package/lib/actions/signin/index.d.ts +4 -0
- package/lib/actions/signin/index.d.ts.map +1 -0
- package/lib/actions/signin/index.js +22 -0
- package/lib/actions/signin/send-token.d.ts +10 -0
- package/lib/actions/signin/send-token.d.ts.map +1 -0
- package/lib/actions/signin/send-token.js +98 -0
- package/lib/actions/signout.d.ts +11 -0
- package/lib/actions/signout.d.ts.map +1 -0
- package/lib/actions/signout.js +30 -0
- package/lib/actions/webauthn-options.d.ts +8 -0
- package/lib/actions/webauthn-options.d.ts.map +1 -0
- package/lib/actions/webauthn-options.js +60 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +70 -0
- package/lib/init.d.ts +25 -0
- package/lib/init.d.ts.map +1 -0
- package/lib/init.js +172 -0
- package/lib/pages/error.d.ts +17 -0
- package/lib/pages/error.d.ts.map +1 -0
- package/lib/pages/error.js +40 -0
- package/lib/pages/index.d.ts +42 -0
- package/lib/pages/index.d.ts.map +1 -0
- package/lib/pages/index.js +136 -0
- package/lib/pages/signin.d.ts +10 -0
- package/lib/pages/signin.d.ts.map +1 -0
- package/lib/pages/signin.js +75 -0
- package/lib/pages/signout.d.ts +8 -0
- package/lib/pages/signout.d.ts.map +1 -0
- package/lib/pages/signout.js +17 -0
- package/lib/pages/styles.d.ts +3 -0
- package/lib/pages/styles.d.ts.map +1 -0
- package/lib/pages/styles.js +381 -0
- package/lib/pages/verify-request.d.ts +8 -0
- package/lib/pages/verify-request.d.ts.map +1 -0
- package/lib/pages/verify-request.js +11 -0
- package/lib/symbols.d.ts +50 -0
- package/lib/symbols.d.ts.map +1 -0
- package/lib/symbols.js +57 -0
- package/lib/utils/actions.d.ts +3 -0
- package/lib/utils/actions.d.ts.map +1 -0
- package/lib/utils/actions.js +14 -0
- package/lib/utils/assert.d.ts +14 -0
- package/lib/utils/assert.d.ts.map +1 -0
- package/lib/utils/assert.js +168 -0
- package/lib/utils/callback-url.d.ts +17 -0
- package/lib/utils/callback-url.d.ts.map +1 -0
- package/lib/utils/callback-url.js +27 -0
- package/lib/utils/cookie.d.ts +111 -0
- package/lib/utils/cookie.d.ts.map +1 -0
- package/lib/utils/cookie.js +205 -0
- package/lib/utils/date.d.ts +7 -0
- package/lib/utils/date.d.ts.map +1 -0
- package/lib/utils/date.js +8 -0
- package/lib/utils/email.d.ts +20 -0
- package/lib/utils/email.d.ts.map +1 -0
- package/lib/utils/email.js +57 -0
- package/lib/utils/env.d.ts +9 -0
- package/lib/utils/env.d.ts.map +1 -0
- package/lib/utils/env.js +96 -0
- package/lib/utils/logger.d.ts +18 -0
- package/lib/utils/logger.d.ts.map +1 -0
- package/lib/utils/logger.js +50 -0
- package/lib/utils/merge.d.ts +3 -0
- package/lib/utils/merge.d.ts.map +1 -0
- package/lib/utils/merge.js +23 -0
- package/lib/utils/providers.d.ts +19 -0
- package/lib/utils/providers.d.ts.map +1 -0
- package/lib/utils/providers.js +149 -0
- package/lib/utils/session.d.ts +7 -0
- package/lib/utils/session.d.ts.map +1 -0
- package/lib/utils/session.js +29 -0
- package/lib/utils/web.d.ts +10 -0
- package/lib/utils/web.d.ts.map +1 -0
- package/lib/utils/web.js +109 -0
- package/lib/utils/webauthn-client.d.ts +30 -0
- package/lib/utils/webauthn-client.d.ts.map +1 -0
- package/lib/utils/webauthn-client.js +197 -0
- package/lib/utils/webauthn-utils.d.ts +81 -0
- package/lib/utils/webauthn-utils.d.ts.map +1 -0
- package/lib/utils/webauthn-utils.js +343 -0
- package/lib/vendored/cookie.d.ts +120 -0
- package/lib/vendored/cookie.d.ts.map +1 -0
- package/lib/vendored/cookie.js +237 -0
- package/package.json +118 -0
- package/providers/42-school.d.ts +240 -0
- package/providers/42-school.d.ts.map +1 -0
- package/providers/42-school.js +78 -0
- package/providers/apple.d.ts +149 -0
- package/providers/apple.d.ts.map +1 -0
- package/providers/apple.js +104 -0
- package/providers/asgardeo.d.ts +102 -0
- package/providers/asgardeo.d.ts.map +1 -0
- package/providers/asgardeo.js +93 -0
- package/providers/atlassian.d.ts +94 -0
- package/providers/atlassian.d.ts.map +1 -0
- package/providers/atlassian.js +84 -0
- package/providers/auth0.d.ts +116 -0
- package/providers/auth0.d.ts.map +1 -0
- package/providers/auth0.js +49 -0
- package/providers/authentik.d.ts +90 -0
- package/providers/authentik.d.ts.map +1 -0
- package/providers/authentik.js +65 -0
- package/providers/azure-ad-b2c.d.ts +104 -0
- package/providers/azure-ad-b2c.d.ts.map +1 -0
- package/providers/azure-ad-b2c.js +100 -0
- package/providers/azure-ad.d.ts +19 -0
- package/providers/azure-ad.d.ts.map +1 -0
- package/providers/azure-ad.js +23 -0
- package/providers/azure-devops.d.ts +128 -0
- package/providers/azure-devops.d.ts.map +1 -0
- package/providers/azure-devops.js +158 -0
- package/providers/bankid-no.d.ts +134 -0
- package/providers/bankid-no.d.ts.map +1 -0
- package/providers/bankid-no.js +65 -0
- package/providers/battlenet.d.ts +85 -0
- package/providers/battlenet.d.ts.map +1 -0
- package/providers/battlenet.js +81 -0
- package/providers/beyondidentity.d.ts +77 -0
- package/providers/beyondidentity.d.ts.map +1 -0
- package/providers/beyondidentity.js +84 -0
- package/providers/bitbucket.d.ts +89 -0
- package/providers/bitbucket.d.ts.map +1 -0
- package/providers/bitbucket.js +92 -0
- package/providers/box.d.ts +63 -0
- package/providers/box.d.ts.map +1 -0
- package/providers/box.js +73 -0
- package/providers/boxyhq-saml.d.ts +121 -0
- package/providers/boxyhq-saml.d.ts.map +1 -0
- package/providers/boxyhq-saml.js +127 -0
- package/providers/bungie.d.ts +167 -0
- package/providers/bungie.d.ts.map +1 -0
- package/providers/bungie.js +174 -0
- package/providers/click-up.d.ts +75 -0
- package/providers/click-up.d.ts.map +1 -0
- package/providers/click-up.js +89 -0
- package/providers/cognito.d.ts +81 -0
- package/providers/cognito.d.ts.map +1 -0
- package/providers/cognito.js +73 -0
- package/providers/coinbase.d.ts +69 -0
- package/providers/coinbase.d.ts.map +1 -0
- package/providers/coinbase.js +78 -0
- package/providers/concept2.d.ts +81 -0
- package/providers/concept2.d.ts.map +1 -0
- package/providers/concept2.js +86 -0
- package/providers/credentials.d.ts +132 -0
- package/providers/credentials.d.ts.map +1 -0
- package/providers/credentials.js +74 -0
- package/providers/descope.d.ts +91 -0
- package/providers/descope.d.ts.map +1 -0
- package/providers/descope.js +78 -0
- package/providers/discord.d.ts +139 -0
- package/providers/discord.d.ts.map +1 -0
- package/providers/discord.js +86 -0
- package/providers/dribbble.d.ts +88 -0
- package/providers/dribbble.d.ts.map +1 -0
- package/providers/dribbble.js +85 -0
- package/providers/dropbox.d.ts +65 -0
- package/providers/dropbox.d.ts.map +1 -0
- package/providers/dropbox.js +88 -0
- package/providers/duende-identity-server6.d.ts +91 -0
- package/providers/duende-identity-server6.d.ts.map +1 -0
- package/providers/duende-identity-server6.js +80 -0
- package/providers/email.d.ts +41 -0
- package/providers/email.d.ts.map +1 -0
- package/providers/email.js +18 -0
- package/providers/eventbrite.d.ts +78 -0
- package/providers/eventbrite.d.ts.map +1 -0
- package/providers/eventbrite.js +88 -0
- package/providers/eveonline.d.ts +94 -0
- package/providers/eveonline.d.ts.map +1 -0
- package/providers/eveonline.js +92 -0
- package/providers/facebook.d.ts +84 -0
- package/providers/facebook.d.ts.map +1 -0
- package/providers/facebook.js +93 -0
- package/providers/faceit.d.ts +64 -0
- package/providers/faceit.d.ts.map +1 -0
- package/providers/faceit.js +74 -0
- package/providers/figma.d.ts +75 -0
- package/providers/figma.d.ts.map +1 -0
- package/providers/figma.js +81 -0
- package/providers/forwardemail.d.ts +4 -0
- package/providers/forwardemail.d.ts.map +1 -0
- package/providers/forwardemail.js +32 -0
- package/providers/foursquare.d.ts +71 -0
- package/providers/foursquare.d.ts.map +1 -0
- package/providers/foursquare.js +91 -0
- package/providers/freshbooks.d.ts +66 -0
- package/providers/freshbooks.d.ts.map +1 -0
- package/providers/freshbooks.js +76 -0
- package/providers/frontegg.d.ts +95 -0
- package/providers/frontegg.d.ts.map +1 -0
- package/providers/frontegg.js +88 -0
- package/providers/fusionauth.d.ts +279 -0
- package/providers/fusionauth.d.ts.map +1 -0
- package/providers/fusionauth.js +292 -0
- package/providers/github.d.ts +127 -0
- package/providers/github.d.ts.map +1 -0
- package/providers/github.js +115 -0
- package/providers/gitlab.d.ts +115 -0
- package/providers/gitlab.d.ts.map +1 -0
- package/providers/gitlab.js +75 -0
- package/providers/google.d.ts +138 -0
- package/providers/google.d.ts.map +1 -0
- package/providers/google.js +119 -0
- package/providers/hubspot.d.ts +76 -0
- package/providers/hubspot.d.ts.map +1 -0
- package/providers/hubspot.js +93 -0
- package/providers/huggingface.d.ts +216 -0
- package/providers/huggingface.d.ts.map +1 -0
- package/providers/huggingface.js +101 -0
- package/providers/identity-server4.d.ts +69 -0
- package/providers/identity-server4.d.ts.map +1 -0
- package/providers/identity-server4.js +64 -0
- package/providers/index.d.ts +61 -0
- package/providers/index.d.ts.map +1 -0
- package/providers/index.js +3 -0
- package/providers/instagram.d.ts +74 -0
- package/providers/instagram.d.ts.map +1 -0
- package/providers/instagram.js +87 -0
- package/providers/kakao.d.ts +148 -0
- package/providers/kakao.d.ts.map +1 -0
- package/providers/kakao.js +103 -0
- package/providers/keycloak.d.ts +100 -0
- package/providers/keycloak.d.ts.map +1 -0
- package/providers/keycloak.js +73 -0
- package/providers/kinde.d.ts +73 -0
- package/providers/kinde.d.ts.map +1 -0
- package/providers/kinde.js +51 -0
- package/providers/line.d.ts +83 -0
- package/providers/line.d.ts.map +1 -0
- package/providers/line.js +73 -0
- package/providers/linkedin.d.ts +77 -0
- package/providers/linkedin.d.ts.map +1 -0
- package/providers/linkedin.js +65 -0
- package/providers/logto.d.ts +98 -0
- package/providers/logto.d.ts.map +1 -0
- package/providers/logto.js +81 -0
- package/providers/loops.d.ts +40 -0
- package/providers/loops.d.ts.map +1 -0
- package/providers/loops.js +59 -0
- package/providers/mailchimp.d.ts +66 -0
- package/providers/mailchimp.d.ts.map +1 -0
- package/providers/mailchimp.js +76 -0
- package/providers/mailgun.d.ts +55 -0
- package/providers/mailgun.d.ts.map +1 -0
- package/providers/mailgun.js +74 -0
- package/providers/mailru.d.ts +63 -0
- package/providers/mailru.d.ts.map +1 -0
- package/providers/mailru.js +61 -0
- package/providers/mastodon.d.ts +90 -0
- package/providers/mastodon.d.ts.map +1 -0
- package/providers/mastodon.js +75 -0
- package/providers/mattermost.d.ts +132 -0
- package/providers/mattermost.d.ts.map +1 -0
- package/providers/mattermost.js +83 -0
- package/providers/medium.d.ts +68 -0
- package/providers/medium.d.ts.map +1 -0
- package/providers/medium.js +84 -0
- package/providers/microsoft-entra-id.d.ts +428 -0
- package/providers/microsoft-entra-id.d.ts.map +1 -0
- package/providers/microsoft-entra-id.js +156 -0
- package/providers/naver.d.ts +80 -0
- package/providers/naver.d.ts.map +1 -0
- package/providers/naver.js +79 -0
- package/providers/netlify.d.ts +66 -0
- package/providers/netlify.d.ts.map +1 -0
- package/providers/netlify.js +85 -0
- package/providers/netsuite.d.ts +189 -0
- package/providers/netsuite.d.ts.map +1 -0
- package/providers/netsuite.js +170 -0
- package/providers/nextcloud.d.ts +150 -0
- package/providers/nextcloud.d.ts.map +1 -0
- package/providers/nextcloud.js +99 -0
- package/providers/nodemailer.d.ts +27 -0
- package/providers/nodemailer.d.ts.map +1 -0
- package/providers/nodemailer.js +34 -0
- package/providers/notion.d.ts +99 -0
- package/providers/notion.d.ts.map +1 -0
- package/providers/notion.js +110 -0
- package/providers/oauth.d.ts +188 -0
- package/providers/oauth.d.ts.map +1 -0
- package/providers/oauth.js +1 -0
- package/providers/okta.d.ts +99 -0
- package/providers/okta.d.ts.map +1 -0
- package/providers/okta.js +63 -0
- package/providers/onelogin.d.ts +65 -0
- package/providers/onelogin.d.ts.map +1 -0
- package/providers/onelogin.js +61 -0
- package/providers/ory-hydra.d.ts +79 -0
- package/providers/ory-hydra.d.ts.map +1 -0
- package/providers/ory-hydra.js +67 -0
- package/providers/osso.d.ts +79 -0
- package/providers/osso.d.ts.map +1 -0
- package/providers/osso.js +77 -0
- package/providers/osu.d.ts +116 -0
- package/providers/osu.d.ts.map +1 -0
- package/providers/osu.js +75 -0
- package/providers/passage.d.ts +88 -0
- package/providers/passage.d.ts.map +1 -0
- package/providers/passage.js +75 -0
- package/providers/passkey.d.ts +65 -0
- package/providers/passkey.d.ts.map +1 -0
- package/providers/passkey.js +87 -0
- package/providers/patreon.d.ts +73 -0
- package/providers/patreon.d.ts.map +1 -0
- package/providers/patreon.js +77 -0
- package/providers/ping-id.d.ts +57 -0
- package/providers/ping-id.d.ts.map +1 -0
- package/providers/ping-id.js +40 -0
- package/providers/pinterest.d.ts +79 -0
- package/providers/pinterest.d.ts.map +1 -0
- package/providers/pinterest.js +85 -0
- package/providers/pipedrive.d.ts +99 -0
- package/providers/pipedrive.d.ts.map +1 -0
- package/providers/pipedrive.js +71 -0
- package/providers/postmark.d.ts +4 -0
- package/providers/postmark.d.ts.map +1 -0
- package/providers/postmark.js +36 -0
- package/providers/provider-types.d.ts +3 -0
- package/providers/provider-types.d.ts.map +1 -0
- package/providers/provider-types.js +1 -0
- package/providers/reddit.d.ts +88 -0
- package/providers/reddit.d.ts.map +1 -0
- package/providers/reddit.js +90 -0
- package/providers/resend.d.ts +4 -0
- package/providers/resend.d.ts.map +1 -0
- package/providers/resend.js +32 -0
- package/providers/roblox.d.ts +67 -0
- package/providers/roblox.d.ts.map +1 -0
- package/providers/roblox.js +53 -0
- package/providers/salesforce.d.ts +59 -0
- package/providers/salesforce.d.ts.map +1 -0
- package/providers/salesforce.js +52 -0
- package/providers/sendgrid.d.ts +4 -0
- package/providers/sendgrid.d.ts.map +1 -0
- package/providers/sendgrid.js +35 -0
- package/providers/simplelogin.d.ts +87 -0
- package/providers/simplelogin.d.ts.map +1 -0
- package/providers/simplelogin.js +83 -0
- package/providers/slack.d.ts +102 -0
- package/providers/slack.d.ts.map +1 -0
- package/providers/slack.js +69 -0
- package/providers/spotify.d.ts +75 -0
- package/providers/spotify.d.ts.map +1 -0
- package/providers/spotify.js +73 -0
- package/providers/strava.d.ts +68 -0
- package/providers/strava.d.ts.map +1 -0
- package/providers/strava.js +80 -0
- package/providers/threads.d.ts +108 -0
- package/providers/threads.d.ts.map +1 -0
- package/providers/threads.js +89 -0
- package/providers/tiktok.d.ts +248 -0
- package/providers/tiktok.d.ts.map +1 -0
- package/providers/tiktok.js +195 -0
- package/providers/todoist.d.ts +76 -0
- package/providers/todoist.d.ts.map +1 -0
- package/providers/todoist.js +97 -0
- package/providers/trakt.d.ts +93 -0
- package/providers/trakt.d.ts.map +1 -0
- package/providers/trakt.js +91 -0
- package/providers/twitch.d.ts +71 -0
- package/providers/twitch.d.ts.map +1 -0
- package/providers/twitch.js +96 -0
- package/providers/twitter.d.ts +183 -0
- package/providers/twitter.d.ts.map +1 -0
- package/providers/twitter.js +100 -0
- package/providers/united-effects.d.ts +80 -0
- package/providers/united-effects.d.ts.map +1 -0
- package/providers/united-effects.js +72 -0
- package/providers/vipps.d.ts +71 -0
- package/providers/vipps.d.ts.map +1 -0
- package/providers/vipps.js +33 -0
- package/providers/vk.d.ts +334 -0
- package/providers/vk.d.ts.map +1 -0
- package/providers/vk.js +103 -0
- package/providers/webauthn.d.ts +148 -0
- package/providers/webauthn.d.ts.map +1 -0
- package/providers/webauthn.js +128 -0
- package/providers/webex.d.ts +78 -0
- package/providers/webex.d.ts.map +1 -0
- package/providers/webex.js +73 -0
- package/providers/wechat.d.ts +78 -0
- package/providers/wechat.d.ts.map +1 -0
- package/providers/wechat.js +105 -0
- package/providers/wikimedia.d.ts +99 -0
- package/providers/wikimedia.d.ts.map +1 -0
- package/providers/wikimedia.js +90 -0
- package/providers/wordpress.d.ts +65 -0
- package/providers/wordpress.d.ts.map +1 -0
- package/providers/wordpress.js +71 -0
- package/providers/workos.d.ts +154 -0
- package/providers/workos.d.ts.map +1 -0
- package/providers/workos.js +143 -0
- package/providers/yandex.d.ts +131 -0
- package/providers/yandex.d.ts.map +1 -0
- package/providers/yandex.js +80 -0
- package/providers/zitadel.d.ts +117 -0
- package/providers/zitadel.d.ts.map +1 -0
- package/providers/zitadel.js +95 -0
- package/providers/zoho.d.ts +63 -0
- package/providers/zoho.d.ts.map +1 -0
- package/providers/zoho.js +79 -0
- package/providers/zoom.d.ts +93 -0
- package/providers/zoom.d.ts.map +1 -0
- package/providers/zoom.js +82 -0
- package/src/adapters/server-actions-helpers.ts +126 -0
- package/src/adapters.ts +603 -0
- package/src/errors.ts +551 -0
- package/src/index.ts +689 -0
- package/src/jwt.ts +283 -0
- package/src/lib/actions/callback/handle-login.ts +334 -0
- package/src/lib/actions/callback/index.ts +554 -0
- package/src/lib/actions/callback/oauth/callback.ts +347 -0
- package/src/lib/actions/callback/oauth/checks.ts +258 -0
- package/src/lib/actions/callback/oauth/csrf-token.ts +60 -0
- package/src/lib/actions/index.ts +5 -0
- package/src/lib/actions/session.ts +167 -0
- package/src/lib/actions/signin/authorization-url.ts +123 -0
- package/src/lib/actions/signin/index.ts +37 -0
- package/src/lib/actions/signin/send-token.ts +124 -0
- package/src/lib/actions/signout.ts +38 -0
- package/src/lib/actions/webauthn-options.ts +100 -0
- package/src/lib/index.ts +97 -0
- package/src/lib/init.ts +236 -0
- package/src/lib/pages/error.tsx +106 -0
- package/src/lib/pages/index.ts +181 -0
- package/src/lib/pages/signin.tsx +255 -0
- package/src/lib/pages/signout.tsx +49 -0
- package/src/lib/pages/styles.css +377 -0
- package/src/lib/pages/styles.ts +381 -0
- package/src/lib/pages/verify-request.tsx +36 -0
- package/src/lib/symbols.ts +60 -0
- package/src/lib/utils/actions.ts +17 -0
- package/src/lib/utils/assert.ts +259 -0
- package/src/lib/utils/callback-url.ts +42 -0
- package/src/lib/utils/cookie.ts +248 -0
- package/src/lib/utils/date.ts +8 -0
- package/src/lib/utils/email.ts +65 -0
- package/src/lib/utils/env.ts +113 -0
- package/src/lib/utils/logger.ts +75 -0
- package/src/lib/utils/merge.ts +30 -0
- package/src/lib/utils/providers.ts +203 -0
- package/src/lib/utils/session.ts +41 -0
- package/src/lib/utils/web.ts +151 -0
- package/src/lib/utils/webauthn-client.js +229 -0
- package/src/lib/utils/webauthn-utils.ts +531 -0
- package/src/lib/vendored/cookie.ts +383 -0
- package/src/providers/42-school.ts +256 -0
- package/src/providers/apple.ts +206 -0
- package/src/providers/asgardeo.ts +118 -0
- package/src/providers/atlassian.ts +120 -0
- package/src/providers/auth0.ts +127 -0
- package/src/providers/authentik.ts +100 -0
- package/src/providers/azure-ad-b2c.ts +124 -0
- package/src/providers/azure-ad.ts +30 -0
- package/src/providers/azure-devops.ts +184 -0
- package/src/providers/bankid-no.ts +161 -0
- package/src/providers/battlenet.ts +107 -0
- package/src/providers/beyondidentity.ts +102 -0
- package/src/providers/bitbucket.ts +122 -0
- package/src/providers/box.ts +87 -0
- package/src/providers/boxyhq-saml.ts +148 -0
- package/src/providers/bungie.ts +192 -0
- package/src/providers/click-up.ts +104 -0
- package/src/providers/cognito.ts +94 -0
- package/src/providers/coinbase.ts +93 -0
- package/src/providers/concept2.ts +108 -0
- package/src/providers/credentials.ts +157 -0
- package/src/providers/descope.ts +105 -0
- package/src/providers/discord.ts +176 -0
- package/src/providers/dribbble.ts +122 -0
- package/src/providers/dropbox.ts +102 -0
- package/src/providers/duende-identity-server6.ts +101 -0
- package/src/providers/email.ts +60 -0
- package/src/providers/eventbrite.ts +105 -0
- package/src/providers/eveonline.ts +117 -0
- package/src/providers/facebook.ts +119 -0
- package/src/providers/faceit.ts +90 -0
- package/src/providers/figma.ts +105 -0
- package/src/providers/forwardemail.ts +37 -0
- package/src/providers/foursquare.ts +105 -0
- package/src/providers/freshbooks.ts +90 -0
- package/src/providers/frontegg.ts +111 -0
- package/src/providers/fusionauth.ts +336 -0
- package/src/providers/github.ts +187 -0
- package/src/providers/gitlab.ts +140 -0
- package/src/providers/google.ts +152 -0
- package/src/providers/hubspot.ts +117 -0
- package/src/providers/huggingface.ts +234 -0
- package/src/providers/identity-server4.ts +78 -0
- package/src/providers/index.ts +115 -0
- package/src/providers/instagram.ts +103 -0
- package/src/providers/kakao.ts +184 -0
- package/src/providers/keycloak.ts +111 -0
- package/src/providers/kinde.ts +85 -0
- package/src/providers/line.ts +99 -0
- package/src/providers/linkedin.ts +91 -0
- package/src/providers/logto.ts +122 -0
- package/src/providers/loops.ts +79 -0
- package/src/providers/mailchimp.ts +90 -0
- package/src/providers/mailgun.ts +98 -0
- package/src/providers/mailru.ts +75 -0
- package/src/providers/mastodon.ts +112 -0
- package/src/providers/mattermost.ts +154 -0
- package/src/providers/medium.ts +89 -0
- package/src/providers/microsoft-entra-id.ts +497 -0
- package/src/providers/naver.ts +102 -0
- package/src/providers/netlify.ts +90 -0
- package/src/providers/netsuite.ts +225 -0
- package/src/providers/nextcloud.ts +207 -0
- package/src/providers/nodemailer.ts +84 -0
- package/src/providers/notion.ts +166 -0
- package/src/providers/oauth.ts +310 -0
- package/src/providers/okta.ts +111 -0
- package/src/providers/onelogin.ts +75 -0
- package/src/providers/ory-hydra.ts +93 -0
- package/src/providers/osso.ts +91 -0
- package/src/providers/osu.ts +138 -0
- package/src/providers/passage.ts +103 -0
- package/src/providers/passkey.ts +94 -0
- package/src/providers/patreon.ts +98 -0
- package/src/providers/ping-id.ts +68 -0
- package/src/providers/pinterest.ts +106 -0
- package/src/providers/pipedrive.ts +120 -0
- package/src/providers/postmark.ts +38 -0
- package/src/providers/provider-types.ts +107 -0
- package/src/providers/reddit.ts +104 -0
- package/src/providers/resend.ts +35 -0
- package/src/providers/roblox.ts +94 -0
- package/src/providers/salesforce.ts +73 -0
- package/src/providers/sendgrid.ts +36 -0
- package/src/providers/simplelogin.ts +107 -0
- package/src/providers/slack.ts +115 -0
- package/src/providers/spotify.ts +99 -0
- package/src/providers/strava.ts +101 -0
- package/src/providers/threads.ts +135 -0
- package/src/providers/tiktok.ts +319 -0
- package/src/providers/todoist.ts +122 -0
- package/src/providers/trakt.ts +120 -0
- package/src/providers/twitch.ts +121 -0
- package/src/providers/twitter.ts +207 -0
- package/src/providers/united-effects.ts +89 -0
- package/src/providers/vipps.ts +86 -0
- package/src/providers/vk.ts +401 -0
- package/src/providers/webauthn.ts +296 -0
- package/src/providers/webex.ts +102 -0
- package/src/providers/wechat.ts +141 -0
- package/src/providers/wikimedia.ts +258 -0
- package/src/providers/wordpress.ts +86 -0
- package/src/providers/workos.ts +180 -0
- package/src/providers/yandex.ts +159 -0
- package/src/providers/zitadel.ts +128 -0
- package/src/providers/zoho.ts +84 -0
- package/src/providers/zoom.ts +119 -0
- package/src/types.ts +430 -0
- package/src/warnings.ts +21 -0
- package/types.d.ts +309 -0
- package/types.d.ts.map +1 -0
- package/types.js +53 -0
- package/warnings.d.ts +17 -0
- package/warnings.d.ts.map +1 -0
- package/warnings.js +1 -0
package/types.d.ts
ADDED
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* This module contains public types and interfaces of the core package.
|
|
4
|
+
*
|
|
5
|
+
* ## Installation
|
|
6
|
+
*
|
|
7
|
+
* ```bash npm2yarn
|
|
8
|
+
* npm install @auth/core
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* You can then import this submodule from `@auth/core/types`.
|
|
12
|
+
*
|
|
13
|
+
* ## Usage
|
|
14
|
+
*
|
|
15
|
+
* Even if you don't use TypeScript, IDEs like VS Code will pick up types to provide you with a better developer experience.
|
|
16
|
+
* While you are typing, you will get suggestions about what certain objects/functions look like,
|
|
17
|
+
* and sometimes links to documentation, examples, and other valuable resources.
|
|
18
|
+
*
|
|
19
|
+
* Generally, you will not need to import types from this module.
|
|
20
|
+
* Mostly when using the `Auth` function and optionally the `AuthConfig` interface,
|
|
21
|
+
* everything inside there will already be typed.
|
|
22
|
+
*
|
|
23
|
+
* :::tip
|
|
24
|
+
* Inside the `Auth` function, you won't need to use a single type from this module.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts title=index.ts
|
|
28
|
+
* import { Auth } from "@auth/core"
|
|
29
|
+
*
|
|
30
|
+
* const request = new Request("https://example.com")
|
|
31
|
+
* const response = await Auth(request, {
|
|
32
|
+
* callbacks: {
|
|
33
|
+
* jwt(): JWT { // <-- This is unnecessary!
|
|
34
|
+
* return { foo: "bar" }
|
|
35
|
+
* },
|
|
36
|
+
* session(
|
|
37
|
+
* { session, token }: { session: Session; token: JWT } // <-- This is unnecessary!
|
|
38
|
+
* ) {
|
|
39
|
+
* return session
|
|
40
|
+
* },
|
|
41
|
+
* }
|
|
42
|
+
* })
|
|
43
|
+
* ```
|
|
44
|
+
* :::
|
|
45
|
+
*
|
|
46
|
+
* ## Resources
|
|
47
|
+
*
|
|
48
|
+
* - [TypeScript - The Basics](https://www.typescriptlang.org/docs/handbook/2/basic-types.html)
|
|
49
|
+
* - [Extending built-in types](https://authjs.dev/getting-started/typescript#module-augmentation)
|
|
50
|
+
*
|
|
51
|
+
* @module types
|
|
52
|
+
*/
|
|
53
|
+
import type { SerializeOptions } from "./lib/vendored/cookie.js";
|
|
54
|
+
import type { TokenEndpointResponse } from "oauth4webapi";
|
|
55
|
+
import type { Cookie } from "./lib/utils/cookie.js";
|
|
56
|
+
import type { LoggerInstance } from "./lib/utils/logger.js";
|
|
57
|
+
import type { WarningCode } from "./warnings.js";
|
|
58
|
+
import type { ProviderType } from "./providers/index.js";
|
|
59
|
+
export type { WebAuthnOptionsResponseBody } from "./lib/utils/webauthn-utils.js";
|
|
60
|
+
export type { AuthConfig } from "./index.js";
|
|
61
|
+
export type { LoggerInstance, WarningCode };
|
|
62
|
+
export type Awaitable<T> = T | PromiseLike<T>;
|
|
63
|
+
export type Awaited<T> = T extends Promise<infer U> ? U : T;
|
|
64
|
+
export type SemverString = `v${number}` | `v${number}.${number}` | `v${number}.${number}.${number}`;
|
|
65
|
+
/**
|
|
66
|
+
* Change the theme of the built-in pages.
|
|
67
|
+
*
|
|
68
|
+
* [Documentation](https://authjs.dev/reference/core#theme) |
|
|
69
|
+
* [Pages](https://authjs.dev/guides/pages/signin)
|
|
70
|
+
*/
|
|
71
|
+
export interface Theme {
|
|
72
|
+
colorScheme?: "auto" | "dark" | "light";
|
|
73
|
+
logo?: string;
|
|
74
|
+
brandColor?: string;
|
|
75
|
+
buttonText?: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Different tokens returned by OAuth Providers.
|
|
79
|
+
* Some of them are available with different casing,
|
|
80
|
+
* but they refer to the same value.
|
|
81
|
+
*/
|
|
82
|
+
export type TokenSet = Partial<TokenEndpointResponse> & {
|
|
83
|
+
/**
|
|
84
|
+
* Date of when the `access_token` expires in seconds.
|
|
85
|
+
* This value is calculated from the `expires_in` value.
|
|
86
|
+
*
|
|
87
|
+
* @see https://www.ietf.org/rfc/rfc6749.html#section-4.2.2
|
|
88
|
+
*/
|
|
89
|
+
expires_at?: number;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Usually contains information about the provider being used
|
|
93
|
+
* and also extends `TokenSet`, which is different tokens returned by OAuth Providers.
|
|
94
|
+
*/
|
|
95
|
+
export interface Account extends Partial<TokenEndpointResponse> {
|
|
96
|
+
/** Provider's id for this account. E.g. "google". See the full list at https://authjs.dev/reference/core/providers */
|
|
97
|
+
provider: string;
|
|
98
|
+
/**
|
|
99
|
+
* This value depends on the type of the provider being used to create the account.
|
|
100
|
+
* - oauth/oidc: The OAuth account's id, returned from the `profile()` callback.
|
|
101
|
+
* - email: The user's email address.
|
|
102
|
+
* - credentials: `id` returned from the `authorize()` callback
|
|
103
|
+
*/
|
|
104
|
+
providerAccountId: string;
|
|
105
|
+
/** Provider's type for this account */
|
|
106
|
+
type: ProviderType;
|
|
107
|
+
/**
|
|
108
|
+
* id of the user this account belongs to
|
|
109
|
+
*
|
|
110
|
+
* @see https://authjs.dev/reference/core/adapters#adapteruser
|
|
111
|
+
*/
|
|
112
|
+
userId?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Calculated value based on {@link TokenEndpointResponse.expires_in}.
|
|
115
|
+
*
|
|
116
|
+
* It is the absolute timestamp (in seconds) when the {@link TokenEndpointResponse.access_token} expires.
|
|
117
|
+
*
|
|
118
|
+
* This value can be used for implementing token rotation together with {@link TokenEndpointResponse.refresh_token}.
|
|
119
|
+
*
|
|
120
|
+
* @see https://authjs.dev/guides/refresh-token-rotation#database-strategy
|
|
121
|
+
* @see https://www.rfc-editor.org/rfc/rfc6749#section-5.1
|
|
122
|
+
*/
|
|
123
|
+
expires_at?: number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The user info returned from your OAuth provider.
|
|
127
|
+
*
|
|
128
|
+
* @see https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims
|
|
129
|
+
*/
|
|
130
|
+
export interface Profile {
|
|
131
|
+
id?: string | null;
|
|
132
|
+
sub?: string | null;
|
|
133
|
+
name?: string | null;
|
|
134
|
+
given_name?: string | null;
|
|
135
|
+
family_name?: string | null;
|
|
136
|
+
middle_name?: string | null;
|
|
137
|
+
nickname?: string | null;
|
|
138
|
+
preferred_username?: string | null;
|
|
139
|
+
profile?: string | null;
|
|
140
|
+
picture?: string | null | any;
|
|
141
|
+
website?: string | null;
|
|
142
|
+
email?: string | null;
|
|
143
|
+
email_verified?: boolean | null;
|
|
144
|
+
gender?: string | null;
|
|
145
|
+
birthdate?: string | null;
|
|
146
|
+
zoneinfo?: string | null;
|
|
147
|
+
locale?: string | null;
|
|
148
|
+
phone_number?: string | null;
|
|
149
|
+
updated_at?: Date | string | number | null;
|
|
150
|
+
address?: {
|
|
151
|
+
formatted?: string | null;
|
|
152
|
+
street_address?: string | null;
|
|
153
|
+
locality?: string | null;
|
|
154
|
+
region?: string | null;
|
|
155
|
+
postal_code?: string | null;
|
|
156
|
+
country?: string | null;
|
|
157
|
+
} | null;
|
|
158
|
+
[claim: string]: unknown;
|
|
159
|
+
}
|
|
160
|
+
/** [Documentation](https://authjs.dev/reference/core#cookies) */
|
|
161
|
+
export interface CookieOption {
|
|
162
|
+
name: string;
|
|
163
|
+
options: SerializeOptions;
|
|
164
|
+
}
|
|
165
|
+
/** [Documentation](https://authjs.dev/reference/core#cookies) */
|
|
166
|
+
export interface CookiesOptions {
|
|
167
|
+
sessionToken: Partial<CookieOption>;
|
|
168
|
+
callbackUrl: Partial<CookieOption>;
|
|
169
|
+
csrfToken: Partial<CookieOption>;
|
|
170
|
+
pkceCodeVerifier: Partial<CookieOption>;
|
|
171
|
+
state: Partial<CookieOption>;
|
|
172
|
+
nonce: Partial<CookieOption>;
|
|
173
|
+
webauthnChallenge: Partial<CookieOption>;
|
|
174
|
+
}
|
|
175
|
+
/** TODO: Check if all these are used/correct */
|
|
176
|
+
export type ErrorPageParam = "Configuration" | "AccessDenied" | "Verification";
|
|
177
|
+
/** TODO: Check if all these are used/correct */
|
|
178
|
+
export type SignInPageErrorParam = "Signin" | "OAuthSignin" | "OAuthCallbackError" | "OAuthCreateAccount" | "EmailCreateAccount" | "Callback" | "OAuthAccountNotLinked" | "EmailSignin" | "CredentialsSignin" | "SessionRequired";
|
|
179
|
+
export interface PagesOptions {
|
|
180
|
+
/**
|
|
181
|
+
* The path to the sign in page.
|
|
182
|
+
*
|
|
183
|
+
* The optional "error" query parameter is set to
|
|
184
|
+
* one of the {@link SignInPageErrorParam available} values.
|
|
185
|
+
*
|
|
186
|
+
* @default "/signin"
|
|
187
|
+
*/
|
|
188
|
+
signIn: string;
|
|
189
|
+
signOut: string;
|
|
190
|
+
/**
|
|
191
|
+
* The path to the error page.
|
|
192
|
+
*
|
|
193
|
+
* The optional "error" query parameter is set to
|
|
194
|
+
* one of the {@link ErrorPageParam available} values.
|
|
195
|
+
*
|
|
196
|
+
* @default "/error"
|
|
197
|
+
*/
|
|
198
|
+
error: string;
|
|
199
|
+
verifyRequest: string;
|
|
200
|
+
/** If set, new users will be directed here on first sign in */
|
|
201
|
+
newUser: string;
|
|
202
|
+
}
|
|
203
|
+
type ISODateString = string;
|
|
204
|
+
export interface DefaultSession {
|
|
205
|
+
user?: User;
|
|
206
|
+
expires: ISODateString;
|
|
207
|
+
}
|
|
208
|
+
/** The active session of the logged in user. */
|
|
209
|
+
export interface Session extends DefaultSession {
|
|
210
|
+
}
|
|
211
|
+
export interface DefaultUser {
|
|
212
|
+
id?: string;
|
|
213
|
+
name?: string | null;
|
|
214
|
+
email?: string | null;
|
|
215
|
+
image?: string | null;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* The shape of the returned object in the OAuth providers' `profile` callback,
|
|
219
|
+
* available in the `jwt` and `session` callbacks,
|
|
220
|
+
* or the second parameter of the `session` callback, when using a database.
|
|
221
|
+
*/
|
|
222
|
+
export interface User extends DefaultUser {
|
|
223
|
+
}
|
|
224
|
+
export interface PublicProvider {
|
|
225
|
+
id: string;
|
|
226
|
+
name: string;
|
|
227
|
+
type: string;
|
|
228
|
+
signinUrl: string;
|
|
229
|
+
callbackUrl: string;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Supported actions by Auth.js. Each action map to a REST API endpoint.
|
|
233
|
+
* Some actions have a `GET` and `POST` variant, depending on if the action
|
|
234
|
+
* changes the state of the server.
|
|
235
|
+
*
|
|
236
|
+
* - **`"callback"`**:
|
|
237
|
+
* - **`GET`**: Handles the callback from an [OAuth provider](https://authjs.dev/reference/core/providers#oauth2configprofile).
|
|
238
|
+
* - **`POST`**: Handles the callback from a [Credentials provider](https://authjs.dev/getting-started/providers/credentials#credentialsconfigcredentialsinputs).
|
|
239
|
+
* - **`"csrf"`**: Returns the raw CSRF token, which is saved in a cookie (encrypted).
|
|
240
|
+
* It is used for CSRF protection, implementing the [double submit cookie](https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#double-submit-cookie) technique.
|
|
241
|
+
* :::note
|
|
242
|
+
* Some frameworks have built-in CSRF protection and can therefore disable this action. In this case, the corresponding endpoint will return a 404 response. Read more at [`skipCSRFCheck`](https://authjs.dev/reference/core#skipcsrfcheck).
|
|
243
|
+
* _⚠ We don't recommend manually disabling CSRF protection, unless you know what you're doing._
|
|
244
|
+
* :::
|
|
245
|
+
* - **`"error"`**: Renders the built-in error page.
|
|
246
|
+
* - **`"providers"`**: Returns a client-safe list of all configured providers.
|
|
247
|
+
* - **`"session"`**:
|
|
248
|
+
* - **`GET`**: Returns the user's session if it exists, otherwise `null`.
|
|
249
|
+
* - **`POST`**: Updates the user's session and returns the updated session.
|
|
250
|
+
* - **`"signin"`**:
|
|
251
|
+
* - **`GET`**: Renders the built-in sign-in page.
|
|
252
|
+
* - **`POST`**: Initiates the sign-in flow.
|
|
253
|
+
* - **`"signout"`**:
|
|
254
|
+
* - **`GET`**: Renders the built-in sign-out page.
|
|
255
|
+
* - **`POST`**: Initiates the sign-out flow. This will invalidate the user's session (deleting the cookie, and if there is a session in the database, it will be deleted as well).
|
|
256
|
+
* - **`"verify-request"`**: Renders the built-in verification request page.
|
|
257
|
+
* - **`"webauthn-options"`**:
|
|
258
|
+
* - **`GET`**: Returns the options for the WebAuthn authentication and registration flows.
|
|
259
|
+
*/
|
|
260
|
+
export type AuthAction = "callback" | "csrf" | "error" | "providers" | "session" | "signin" | "signout" | "verify-request" | "webauthn-options";
|
|
261
|
+
export interface ResponseInternal<Body extends string | Record<string, any> | any[] | null = any> {
|
|
262
|
+
status?: number;
|
|
263
|
+
headers?: Headers | HeadersInit;
|
|
264
|
+
body?: Body;
|
|
265
|
+
redirect?: string;
|
|
266
|
+
cookies?: Cookie[];
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* A webauthn authenticator.
|
|
270
|
+
* Represents an entity capable of authenticating the account it references,
|
|
271
|
+
* and contains the auhtenticator's credentials and related information.
|
|
272
|
+
*
|
|
273
|
+
* @see https://www.w3.org/TR/webauthn/#authenticator
|
|
274
|
+
*/
|
|
275
|
+
export interface Authenticator {
|
|
276
|
+
/**
|
|
277
|
+
* ID of the user this authenticator belongs to.
|
|
278
|
+
*/
|
|
279
|
+
userId?: string;
|
|
280
|
+
/**
|
|
281
|
+
* The provider account ID connected to the authenticator.
|
|
282
|
+
*/
|
|
283
|
+
providerAccountId: string;
|
|
284
|
+
/**
|
|
285
|
+
* Number of times the authenticator has been used.
|
|
286
|
+
*/
|
|
287
|
+
counter: number;
|
|
288
|
+
/**
|
|
289
|
+
* Whether the client authenticator backed up the credential.
|
|
290
|
+
*/
|
|
291
|
+
credentialBackedUp: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* Base64 encoded credential ID.
|
|
294
|
+
*/
|
|
295
|
+
credentialID: string;
|
|
296
|
+
/**
|
|
297
|
+
* Base64 encoded credential public key.
|
|
298
|
+
*/
|
|
299
|
+
credentialPublicKey: string;
|
|
300
|
+
/**
|
|
301
|
+
* Concatenated transport flags.
|
|
302
|
+
*/
|
|
303
|
+
transports?: string | null;
|
|
304
|
+
/**
|
|
305
|
+
* Device type of the authenticator.
|
|
306
|
+
*/
|
|
307
|
+
credentialDeviceType: string;
|
|
308
|
+
}
|
|
309
|
+
//# sourceMappingURL=types.d.ts.map
|
package/types.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAIzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAKV,YAAY,EACb,MAAM,sBAAsB,CAAA;AAM7B,YAAY,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAChF,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,CAAA;AAC3C,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;AAC7C,MAAM,MAAM,OAAO,C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|
2
|
+
*
|
|
3
|
+
* This module contains public types and interfaces of the core package.
|
|
4
|
+
*
|
|
5
|
+
* ## Installation
|
|
6
|
+
*
|
|
7
|
+
* ```bash npm2yarn
|
|
8
|
+
* npm install @auth/core
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* You can then import this submodule from `@auth/core/types`.
|
|
12
|
+
*
|
|
13
|
+
* ## Usage
|
|
14
|
+
*
|
|
15
|
+
* Even if you don't use TypeScript, IDEs like VS Code will pick up types to provide you with a better developer experience.
|
|
16
|
+
* While you are typing, you will get suggestions about what certain objects/functions look like,
|
|
17
|
+
* and sometimes links to documentation, examples, and other valuable resources.
|
|
18
|
+
*
|
|
19
|
+
* Generally, you will not need to import types from this module.
|
|
20
|
+
* Mostly when using the `Auth` function and optionally the `AuthConfig` interface,
|
|
21
|
+
* everything inside there will already be typed.
|
|
22
|
+
*
|
|
23
|
+
* :::tip
|
|
24
|
+
* Inside the `Auth` function, you won't need to use a single type from this module.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts title=index.ts
|
|
28
|
+
* import { Auth } from "@auth/core"
|
|
29
|
+
*
|
|
30
|
+
* const request = new Request("https://example.com")
|
|
31
|
+
* const response = await Auth(request, {
|
|
32
|
+
* callbacks: {
|
|
33
|
+
* jwt(): JWT { // <-- This is unnecessary!
|
|
34
|
+
* return { foo: "bar" }
|
|
35
|
+
* },
|
|
36
|
+
* session(
|
|
37
|
+
* { session, token }: { session: Session; token: JWT } // <-- This is unnecessary!
|
|
38
|
+
* ) {
|
|
39
|
+
* return session
|
|
40
|
+
* },
|
|
41
|
+
* }
|
|
42
|
+
* })
|
|
43
|
+
* ```
|
|
44
|
+
* :::
|
|
45
|
+
*
|
|
46
|
+
* ## Resources
|
|
47
|
+
*
|
|
48
|
+
* - [TypeScript - The Basics](https://www.typescriptlang.org/docs/handbook/2/basic-types.html)
|
|
49
|
+
* - [Extending built-in types](https://authjs.dev/getting-started/typescript#module-augmentation)
|
|
50
|
+
*
|
|
51
|
+
* @module types
|
|
52
|
+
*/
|
|
53
|
+
export {};
|
package/warnings.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* - `debug-enabled`: The `debug` option was evaluated to `true`. It adds extra logs in the terminal which is useful in development,
|
|
3
|
+
* but since it can print sensitive information about users, make sure to set this to `false` in production.
|
|
4
|
+
* In Node.js environments, you can for example set `debug: process.env.NODE_ENV !== "production"`.
|
|
5
|
+
* Consult with your runtime/framework on how to set this value correctly.
|
|
6
|
+
* - `csrf-disabled`: You were trying to get a CSRF response from Auth.js (eg.: by calling a `/csrf` endpoint),
|
|
7
|
+
* but in this setup, CSRF protection via Auth.js was turned off. This is likely if you are not directly using `@auth/core`
|
|
8
|
+
* but a framework library (like `@auth/sveltekit`) that already has CSRF protection built-in. You likely won't need the CSRF response.
|
|
9
|
+
* - `env-url-basepath-redundant`: `AUTH_URL` (or `NEXTAUTH_URL`) and `authConfig.basePath` are both declared. This is a configuration mistake - you should either remove the `authConfig.basePath` configuration,
|
|
10
|
+
* or remove the `pathname` of `AUTH_URL` (or `NEXTAUTH_URL`). Only one of them is needed.
|
|
11
|
+
* - `env-url-basepath-mismatch`: `AUTH_URL` (or `NEXTAUTH_URL`) and `authConfig.basePath` are both declared, but they don't match. This is a configuration mistake.
|
|
12
|
+
* `@auth/core` will use `basePath` to construct the full URL to the corresponding action (/signin, /signout, etc.) in this case.
|
|
13
|
+
* - `experimental-webauthn`: Experimental WebAuthn feature is enabled.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export type WarningCode = "debug-enabled" | "csrf-disabled" | "env-url-basepath-redundant" | "env-url-basepath-mismatch" | "experimental-webauthn";
|
|
17
|
+
//# sourceMappingURL=warnings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warnings.d.ts","sourceRoot":"","sources":["src/warnings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,WAAW,GACnB,eAAe,GACf,eAAe,GACf,4BAA4B,GAC5B,2BAA2B,GAC3B,uBAAuB,CAAA"}
|
package/warnings.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|