mulguard 1.1.7 → 1.1.8
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 +21 -582
- package/adapters.d.ts +2 -0
- package/adapters.d.ts.map +1 -0
- package/adapters.js +1 -0
- package/index.d.ts +329 -0
- package/index.d.ts.map +1 -0
- package/index.js +145 -0
- package/jwt.d.ts +9 -0
- package/jwt.d.ts.map +1 -0
- package/jwt.js +8 -0
- package/lib/actions.d.ts +13 -0
- package/lib/actions.d.ts.map +1 -0
- package/lib/actions.js +86 -0
- package/lib/client.d.ts +104 -0
- package/lib/client.d.ts.map +1 -0
- package/lib/client.js +95 -0
- package/lib/env.d.ts +12 -0
- package/lib/env.d.ts.map +1 -0
- package/lib/env.js +38 -0
- package/lib/index.d.ts +56 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +187 -0
- package/lib/types.d.ts +24 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +1 -0
- package/middleware.d.ts +9 -0
- package/middleware.d.ts.map +1 -0
- package/middleware.js +12 -0
- package/next.d.ts +9 -0
- package/next.d.ts.map +1 -0
- package/next.js +12 -0
- package/package.json +117 -126
- package/providers/42-school.d.ts +3 -0
- package/providers/42-school.d.ts.map +1 -0
- package/providers/42-school.js +2 -0
- package/providers/apple.d.ts +3 -0
- package/providers/apple.d.ts.map +1 -0
- package/providers/apple.js +2 -0
- package/providers/asgardeo.d.ts +3 -0
- package/providers/asgardeo.d.ts.map +1 -0
- package/providers/asgardeo.js +2 -0
- package/providers/atlassian.d.ts +3 -0
- package/providers/atlassian.d.ts.map +1 -0
- package/providers/atlassian.js +2 -0
- package/providers/auth0.d.ts +3 -0
- package/providers/auth0.d.ts.map +1 -0
- package/providers/auth0.js +2 -0
- package/providers/authentik.d.ts +3 -0
- package/providers/authentik.d.ts.map +1 -0
- package/providers/authentik.js +2 -0
- package/providers/azure-ad-b2c.d.ts +3 -0
- package/providers/azure-ad-b2c.d.ts.map +1 -0
- package/providers/azure-ad-b2c.js +2 -0
- package/providers/azure-ad.d.ts +3 -0
- package/providers/azure-ad.d.ts.map +1 -0
- package/providers/azure-ad.js +2 -0
- package/providers/azure-devops.d.ts +3 -0
- package/providers/azure-devops.d.ts.map +1 -0
- package/providers/azure-devops.js +2 -0
- package/providers/bankid-no.d.ts +3 -0
- package/providers/bankid-no.d.ts.map +1 -0
- package/providers/bankid-no.js +2 -0
- package/providers/battlenet.d.ts +3 -0
- package/providers/battlenet.d.ts.map +1 -0
- package/providers/battlenet.js +2 -0
- package/providers/beyondidentity.d.ts +3 -0
- package/providers/beyondidentity.d.ts.map +1 -0
- package/providers/beyondidentity.js +2 -0
- package/providers/bitbucket.d.ts +3 -0
- package/providers/bitbucket.d.ts.map +1 -0
- package/providers/bitbucket.js +2 -0
- package/providers/box.d.ts +3 -0
- package/providers/box.d.ts.map +1 -0
- package/providers/box.js +2 -0
- package/providers/boxyhq-saml.d.ts +3 -0
- package/providers/boxyhq-saml.d.ts.map +1 -0
- package/providers/boxyhq-saml.js +2 -0
- package/providers/bungie.d.ts +3 -0
- package/providers/bungie.d.ts.map +1 -0
- package/providers/bungie.js +2 -0
- package/providers/click-up.d.ts +3 -0
- package/providers/click-up.d.ts.map +1 -0
- package/providers/click-up.js +2 -0
- package/providers/cognito.d.ts +3 -0
- package/providers/cognito.d.ts.map +1 -0
- package/providers/cognito.js +2 -0
- package/providers/coinbase.d.ts +3 -0
- package/providers/coinbase.d.ts.map +1 -0
- package/providers/coinbase.js +2 -0
- package/providers/concept2.d.ts +3 -0
- package/providers/concept2.d.ts.map +1 -0
- package/providers/concept2.js +2 -0
- package/providers/credentials.d.ts +3 -0
- package/providers/credentials.d.ts.map +1 -0
- package/providers/credentials.js +2 -0
- package/providers/descope.d.ts +3 -0
- package/providers/descope.d.ts.map +1 -0
- package/providers/descope.js +2 -0
- package/providers/discord.d.ts +3 -0
- package/providers/discord.d.ts.map +1 -0
- package/providers/discord.js +2 -0
- package/providers/dribbble.d.ts +3 -0
- package/providers/dribbble.d.ts.map +1 -0
- package/providers/dribbble.js +2 -0
- package/providers/dropbox.d.ts +3 -0
- package/providers/dropbox.d.ts.map +1 -0
- package/providers/dropbox.js +2 -0
- package/providers/duende-identity-server6.d.ts +3 -0
- package/providers/duende-identity-server6.d.ts.map +1 -0
- package/providers/duende-identity-server6.js +2 -0
- package/providers/email.d.ts +3 -0
- package/providers/email.d.ts.map +1 -0
- package/providers/email.js +2 -0
- package/providers/eventbrite.d.ts +3 -0
- package/providers/eventbrite.d.ts.map +1 -0
- package/providers/eventbrite.js +2 -0
- package/providers/eveonline.d.ts +3 -0
- package/providers/eveonline.d.ts.map +1 -0
- package/providers/eveonline.js +2 -0
- package/providers/facebook.d.ts +3 -0
- package/providers/facebook.d.ts.map +1 -0
- package/providers/facebook.js +2 -0
- package/providers/faceit.d.ts +3 -0
- package/providers/faceit.d.ts.map +1 -0
- package/providers/faceit.js +2 -0
- package/providers/figma.d.ts +3 -0
- package/providers/figma.d.ts.map +1 -0
- package/providers/figma.js +2 -0
- package/providers/forwardemail.d.ts +3 -0
- package/providers/forwardemail.d.ts.map +1 -0
- package/providers/forwardemail.js +2 -0
- package/providers/foursquare.d.ts +3 -0
- package/providers/foursquare.d.ts.map +1 -0
- package/providers/foursquare.js +2 -0
- package/providers/freshbooks.d.ts +3 -0
- package/providers/freshbooks.d.ts.map +1 -0
- package/providers/freshbooks.js +2 -0
- package/providers/frontegg.d.ts +3 -0
- package/providers/frontegg.d.ts.map +1 -0
- package/providers/frontegg.js +2 -0
- package/providers/fusionauth.d.ts +3 -0
- package/providers/fusionauth.d.ts.map +1 -0
- package/providers/fusionauth.js +2 -0
- package/providers/github.d.ts +3 -0
- package/providers/github.d.ts.map +1 -0
- package/providers/github.js +2 -0
- package/providers/gitlab.d.ts +3 -0
- package/providers/gitlab.d.ts.map +1 -0
- package/providers/gitlab.js +2 -0
- package/providers/google.d.ts +3 -0
- package/providers/google.d.ts.map +1 -0
- package/providers/google.js +2 -0
- package/providers/hubspot.d.ts +3 -0
- package/providers/hubspot.d.ts.map +1 -0
- package/providers/hubspot.js +2 -0
- package/providers/huggingface.d.ts +3 -0
- package/providers/huggingface.d.ts.map +1 -0
- package/providers/huggingface.js +2 -0
- package/providers/identity-server4.d.ts +3 -0
- package/providers/identity-server4.d.ts.map +1 -0
- package/providers/identity-server4.js +2 -0
- package/providers/index.d.ts +2 -0
- package/providers/index.d.ts.map +1 -0
- package/providers/index.js +1 -0
- package/providers/instagram.d.ts +3 -0
- package/providers/instagram.d.ts.map +1 -0
- package/providers/instagram.js +2 -0
- package/providers/kakao.d.ts +3 -0
- package/providers/kakao.d.ts.map +1 -0
- package/providers/kakao.js +2 -0
- package/providers/keycloak.d.ts +3 -0
- package/providers/keycloak.d.ts.map +1 -0
- package/providers/keycloak.js +2 -0
- package/providers/kinde.d.ts +3 -0
- package/providers/kinde.d.ts.map +1 -0
- package/providers/kinde.js +2 -0
- package/providers/line.d.ts +3 -0
- package/providers/line.d.ts.map +1 -0
- package/providers/line.js +2 -0
- package/providers/linkedin.d.ts +3 -0
- package/providers/linkedin.d.ts.map +1 -0
- package/providers/linkedin.js +2 -0
- package/providers/logto.d.ts +3 -0
- package/providers/logto.d.ts.map +1 -0
- package/providers/logto.js +2 -0
- package/providers/loops.d.ts +3 -0
- package/providers/loops.d.ts.map +1 -0
- package/providers/loops.js +2 -0
- package/providers/mailchimp.d.ts +3 -0
- package/providers/mailchimp.d.ts.map +1 -0
- package/providers/mailchimp.js +2 -0
- package/providers/mailgun.d.ts +3 -0
- package/providers/mailgun.d.ts.map +1 -0
- package/providers/mailgun.js +2 -0
- package/providers/mailru.d.ts +3 -0
- package/providers/mailru.d.ts.map +1 -0
- package/providers/mailru.js +2 -0
- package/providers/mastodon.d.ts +3 -0
- package/providers/mastodon.d.ts.map +1 -0
- package/providers/mastodon.js +2 -0
- package/providers/mattermost.d.ts +3 -0
- package/providers/mattermost.d.ts.map +1 -0
- package/providers/mattermost.js +2 -0
- package/providers/medium.d.ts +3 -0
- package/providers/medium.d.ts.map +1 -0
- package/providers/medium.js +2 -0
- package/providers/microsoft-entra-id.d.ts +3 -0
- package/providers/microsoft-entra-id.d.ts.map +1 -0
- package/providers/microsoft-entra-id.js +2 -0
- package/providers/naver.d.ts +3 -0
- package/providers/naver.d.ts.map +1 -0
- package/providers/naver.js +2 -0
- package/providers/netlify.d.ts +3 -0
- package/providers/netlify.d.ts.map +1 -0
- package/providers/netlify.js +2 -0
- package/providers/netsuite.d.ts +3 -0
- package/providers/netsuite.d.ts.map +1 -0
- package/providers/netsuite.js +2 -0
- package/providers/nextcloud.d.ts +3 -0
- package/providers/nextcloud.d.ts.map +1 -0
- package/providers/nextcloud.js +2 -0
- package/providers/nodemailer.d.ts +3 -0
- package/providers/nodemailer.d.ts.map +1 -0
- package/providers/nodemailer.js +2 -0
- package/providers/notion.d.ts +3 -0
- package/providers/notion.d.ts.map +1 -0
- package/providers/notion.js +2 -0
- package/providers/okta.d.ts +3 -0
- package/providers/okta.d.ts.map +1 -0
- package/providers/okta.js +2 -0
- package/providers/onelogin.d.ts +3 -0
- package/providers/onelogin.d.ts.map +1 -0
- package/providers/onelogin.js +2 -0
- package/providers/ory-hydra.d.ts +3 -0
- package/providers/ory-hydra.d.ts.map +1 -0
- package/providers/ory-hydra.js +2 -0
- package/providers/osso.d.ts +3 -0
- package/providers/osso.d.ts.map +1 -0
- package/providers/osso.js +2 -0
- package/providers/osu.d.ts +3 -0
- package/providers/osu.d.ts.map +1 -0
- package/providers/osu.js +2 -0
- package/providers/passage.d.ts +3 -0
- package/providers/passage.d.ts.map +1 -0
- package/providers/passage.js +2 -0
- package/providers/passkey.d.ts +3 -0
- package/providers/passkey.d.ts.map +1 -0
- package/providers/passkey.js +2 -0
- package/providers/patreon.d.ts +3 -0
- package/providers/patreon.d.ts.map +1 -0
- package/providers/patreon.js +2 -0
- package/providers/ping-id.d.ts +3 -0
- package/providers/ping-id.d.ts.map +1 -0
- package/providers/ping-id.js +2 -0
- package/providers/pinterest.d.ts +3 -0
- package/providers/pinterest.d.ts.map +1 -0
- package/providers/pinterest.js +2 -0
- package/providers/pipedrive.d.ts +3 -0
- package/providers/pipedrive.d.ts.map +1 -0
- package/providers/pipedrive.js +2 -0
- package/providers/postmark.d.ts +3 -0
- package/providers/postmark.d.ts.map +1 -0
- package/providers/postmark.js +2 -0
- package/providers/reddit.d.ts +3 -0
- package/providers/reddit.d.ts.map +1 -0
- package/providers/reddit.js +2 -0
- package/providers/resend.d.ts +3 -0
- package/providers/resend.d.ts.map +1 -0
- package/providers/resend.js +2 -0
- package/providers/roblox.d.ts +3 -0
- package/providers/roblox.d.ts.map +1 -0
- package/providers/roblox.js +2 -0
- package/providers/salesforce.d.ts +3 -0
- package/providers/salesforce.d.ts.map +1 -0
- package/providers/salesforce.js +2 -0
- package/providers/sendgrid.d.ts +3 -0
- package/providers/sendgrid.d.ts.map +1 -0
- package/providers/sendgrid.js +2 -0
- package/providers/simplelogin.d.ts +3 -0
- package/providers/simplelogin.d.ts.map +1 -0
- package/providers/simplelogin.js +2 -0
- package/providers/slack.d.ts +3 -0
- package/providers/slack.d.ts.map +1 -0
- package/providers/slack.js +2 -0
- package/providers/spotify.d.ts +3 -0
- package/providers/spotify.d.ts.map +1 -0
- package/providers/spotify.js +2 -0
- package/providers/strava.d.ts +3 -0
- package/providers/strava.d.ts.map +1 -0
- package/providers/strava.js +2 -0
- package/providers/threads.d.ts +3 -0
- package/providers/threads.d.ts.map +1 -0
- package/providers/threads.js +2 -0
- package/providers/tiktok.d.ts +3 -0
- package/providers/tiktok.d.ts.map +1 -0
- package/providers/tiktok.js +2 -0
- package/providers/todoist.d.ts +3 -0
- package/providers/todoist.d.ts.map +1 -0
- package/providers/todoist.js +2 -0
- package/providers/trakt.d.ts +3 -0
- package/providers/trakt.d.ts.map +1 -0
- package/providers/trakt.js +2 -0
- package/providers/twitch.d.ts +3 -0
- package/providers/twitch.d.ts.map +1 -0
- package/providers/twitch.js +2 -0
- package/providers/twitter.d.ts +3 -0
- package/providers/twitter.d.ts.map +1 -0
- package/providers/twitter.js +2 -0
- package/providers/united-effects.d.ts +3 -0
- package/providers/united-effects.d.ts.map +1 -0
- package/providers/united-effects.js +2 -0
- package/providers/vipps.d.ts +3 -0
- package/providers/vipps.d.ts.map +1 -0
- package/providers/vipps.js +2 -0
- package/providers/vk.d.ts +3 -0
- package/providers/vk.d.ts.map +1 -0
- package/providers/vk.js +2 -0
- package/providers/webauthn.d.ts +3 -0
- package/providers/webauthn.d.ts.map +1 -0
- package/providers/webauthn.js +2 -0
- package/providers/webex.d.ts +3 -0
- package/providers/webex.d.ts.map +1 -0
- package/providers/webex.js +2 -0
- package/providers/wechat.d.ts +3 -0
- package/providers/wechat.d.ts.map +1 -0
- package/providers/wechat.js +2 -0
- package/providers/wikimedia.d.ts +3 -0
- package/providers/wikimedia.d.ts.map +1 -0
- package/providers/wikimedia.js +2 -0
- package/providers/wordpress.d.ts +3 -0
- package/providers/wordpress.d.ts.map +1 -0
- package/providers/wordpress.js +2 -0
- package/providers/workos.d.ts +3 -0
- package/providers/workos.d.ts.map +1 -0
- package/providers/workos.js +2 -0
- package/providers/yandex.d.ts +3 -0
- package/providers/yandex.d.ts.map +1 -0
- package/providers/yandex.js +2 -0
- package/providers/zitadel.d.ts +3 -0
- package/providers/zitadel.d.ts.map +1 -0
- package/providers/zitadel.js +2 -0
- package/providers/zoho.d.ts +3 -0
- package/providers/zoho.d.ts.map +1 -0
- package/providers/zoho.js +2 -0
- package/providers/zoom.d.ts +3 -0
- package/providers/zoom.d.ts.map +1 -0
- package/providers/zoom.js +2 -0
- package/react.d.ts +102 -0
- package/react.d.ts.map +1 -0
- package/react.js +361 -0
- package/src/adapters.ts +1 -0
- package/src/index.ts +430 -0
- package/src/jwt.ts +9 -0
- package/src/lib/actions.ts +144 -0
- package/src/lib/client.ts +245 -0
- package/src/lib/env.ts +36 -0
- package/src/lib/index.ts +313 -0
- package/src/lib/types.ts +30 -0
- package/src/middleware.ts +16 -0
- package/src/next.ts +16 -0
- package/src/providers/42-school.ts +2 -0
- package/src/providers/apple.ts +2 -0
- package/src/providers/asgardeo.ts +2 -0
- package/src/providers/atlassian.ts +2 -0
- package/src/providers/auth0.ts +2 -0
- package/src/providers/authentik.ts +2 -0
- package/src/providers/azure-ad-b2c.ts +2 -0
- package/src/providers/azure-ad.ts +2 -0
- package/src/providers/azure-devops.ts +2 -0
- package/src/providers/bankid-no.ts +2 -0
- package/src/providers/battlenet.ts +2 -0
- package/src/providers/beyondidentity.ts +2 -0
- package/src/providers/bitbucket.ts +2 -0
- package/src/providers/box.ts +2 -0
- package/src/providers/boxyhq-saml.ts +2 -0
- package/src/providers/bungie.ts +2 -0
- package/src/providers/click-up.ts +2 -0
- package/src/providers/cognito.ts +2 -0
- package/src/providers/coinbase.ts +2 -0
- package/src/providers/concept2.ts +2 -0
- package/src/providers/credentials.ts +2 -0
- package/src/providers/descope.ts +2 -0
- package/src/providers/discord.ts +2 -0
- package/src/providers/dribbble.ts +2 -0
- package/src/providers/dropbox.ts +2 -0
- package/src/providers/duende-identity-server6.ts +2 -0
- package/src/providers/email.ts +2 -0
- package/src/providers/eventbrite.ts +2 -0
- package/src/providers/eveonline.ts +2 -0
- package/src/providers/facebook.ts +2 -0
- package/src/providers/faceit.ts +2 -0
- package/src/providers/figma.ts +2 -0
- package/src/providers/forwardemail.ts +2 -0
- package/src/providers/foursquare.ts +2 -0
- package/src/providers/freshbooks.ts +2 -0
- package/src/providers/frontegg.ts +2 -0
- package/src/providers/fusionauth.ts +2 -0
- package/src/providers/github.ts +2 -0
- package/src/providers/gitlab.ts +2 -0
- package/src/providers/google.ts +2 -0
- package/src/providers/hubspot.ts +2 -0
- package/src/providers/huggingface.ts +2 -0
- package/src/providers/identity-server4.ts +2 -0
- package/src/providers/index.ts +1 -0
- package/src/providers/instagram.ts +2 -0
- package/src/providers/kakao.ts +2 -0
- package/src/providers/keycloak.ts +2 -0
- package/src/providers/kinde.ts +2 -0
- package/src/providers/line.ts +2 -0
- package/src/providers/linkedin.ts +2 -0
- package/src/providers/logto.ts +2 -0
- package/src/providers/loops.ts +2 -0
- package/src/providers/mailchimp.ts +2 -0
- package/src/providers/mailgun.ts +2 -0
- package/src/providers/mailru.ts +2 -0
- package/src/providers/mastodon.ts +2 -0
- package/src/providers/mattermost.ts +2 -0
- package/src/providers/medium.ts +2 -0
- package/src/providers/microsoft-entra-id.ts +2 -0
- package/src/providers/naver.ts +2 -0
- package/src/providers/netlify.ts +2 -0
- package/src/providers/netsuite.ts +2 -0
- package/src/providers/nextcloud.ts +2 -0
- package/src/providers/nodemailer.ts +2 -0
- package/src/providers/notion.ts +2 -0
- package/src/providers/okta.ts +2 -0
- package/src/providers/onelogin.ts +2 -0
- package/src/providers/ory-hydra.ts +2 -0
- package/src/providers/osso.ts +2 -0
- package/src/providers/osu.ts +2 -0
- package/src/providers/passage.ts +2 -0
- package/src/providers/passkey.ts +2 -0
- package/src/providers/patreon.ts +2 -0
- package/src/providers/ping-id.ts +2 -0
- package/src/providers/pinterest.ts +2 -0
- package/src/providers/pipedrive.ts +2 -0
- package/src/providers/postmark.ts +2 -0
- package/src/providers/reddit.ts +2 -0
- package/src/providers/resend.ts +2 -0
- package/src/providers/roblox.ts +2 -0
- package/src/providers/salesforce.ts +2 -0
- package/src/providers/sendgrid.ts +2 -0
- package/src/providers/simplelogin.ts +2 -0
- package/src/providers/slack.ts +2 -0
- package/src/providers/spotify.ts +2 -0
- package/src/providers/strava.ts +2 -0
- package/src/providers/threads.ts +2 -0
- package/src/providers/tiktok.ts +2 -0
- package/src/providers/todoist.ts +2 -0
- package/src/providers/trakt.ts +2 -0
- package/src/providers/twitch.ts +2 -0
- package/src/providers/twitter.ts +2 -0
- package/src/providers/united-effects.ts +2 -0
- package/src/providers/vipps.ts +2 -0
- package/src/providers/vk.ts +2 -0
- package/src/providers/webauthn.ts +2 -0
- package/src/providers/webex.ts +2 -0
- package/src/providers/wechat.ts +2 -0
- package/src/providers/wikimedia.ts +2 -0
- package/src/providers/wordpress.ts +2 -0
- package/src/providers/workos.ts +2 -0
- package/src/providers/yandex.ts +2 -0
- package/src/providers/zitadel.ts +2 -0
- package/src/providers/zoho.ts +2 -0
- package/src/providers/zoom.ts +2 -0
- package/src/react.tsx +546 -0
- package/src/webauthn.ts +152 -0
- package/webauthn.d.ts +9 -0
- package/webauthn.d.ts.map +1 -0
- package/webauthn.js +92 -0
- package/LICENSE +0 -70
- package/dist/actions-CMtg7FGv.js +0 -1
- package/dist/actions-CjQUKaXF.mjs +0 -200
- package/dist/client/index.js +0 -1
- package/dist/client/index.mjs +0 -484
- package/dist/components/AccountPicker.d.ts +0 -11
- package/dist/components/OAuthButton.d.ts +0 -11
- package/dist/components/PassKeyButton.d.ts +0 -11
- package/dist/components/PassKeyRegister.d.ts +0 -10
- package/dist/components/TwoFactorSetup.d.ts +0 -8
- package/dist/components/TwoFactorVerify.d.ts +0 -9
- package/dist/core/account-picker/encryption.d.ts +0 -22
- package/dist/core/account-picker/index.d.ts +0 -22
- package/dist/core/auth/email-password.d.ts +0 -145
- package/dist/core/auth/oauth/index.d.ts +0 -14
- package/dist/core/auth/oauth/oauth-handler.d.ts +0 -172
- package/dist/core/auth/oauth/pkce.d.ts +0 -168
- package/dist/core/auth/oauth/providers.d.ts +0 -198
- package/dist/core/auth/oauth/state-store-cookie.d.ts +0 -83
- package/dist/core/auth/oauth/state-store-redis.d.ts +0 -25
- package/dist/core/auth/oauth/state-store.d.ts +0 -48
- package/dist/core/auth/otp.d.ts +0 -184
- package/dist/core/auth/passkey.d.ts +0 -35
- package/dist/core/auth/password.d.ts +0 -22
- package/dist/core/auth/signin-unified.d.ts +0 -33
- package/dist/core/auth/two-factor.d.ts +0 -28
- package/dist/core/client/index.d.ts +0 -132
- package/dist/core/client/token-refresh-manager.d.ts +0 -48
- package/dist/core/errors/index.d.ts +0 -269
- package/dist/core/index.d.ts +0 -9
- package/dist/core/logger/index.d.ts +0 -147
- package/dist/core/mulguard/auth-handlers.d.ts +0 -100
- package/dist/core/mulguard/defaults.d.ts +0 -58
- package/dist/core/mulguard/index.d.ts +0 -9
- package/dist/core/mulguard/integration.d.ts +0 -104
- package/dist/core/mulguard/oauth-handler.d.ts +0 -93
- package/dist/core/mulguard/session-manager.d.ts +0 -94
- package/dist/core/security/csrf.d.ts +0 -46
- package/dist/core/security/headers.d.ts +0 -24
- package/dist/core/security/index.d.ts +0 -132
- package/dist/core/security/rate-limit.d.ts +0 -39
- package/dist/core/security/security-manager.d.ts +0 -236
- package/dist/core/security/validation.d.ts +0 -251
- package/dist/core/security/xss.d.ts +0 -20
- package/dist/core/session/index.d.ts +0 -35
- package/dist/core/session/session-manager.d.ts +0 -235
- package/dist/core/types/auth.d.ts +0 -290
- package/dist/core/types/errors.d.ts +0 -200
- package/dist/core/types/index.d.ts +0 -484
- package/dist/core/utils/auth-helpers.d.ts +0 -136
- package/dist/core/utils/logger.d.ts +0 -121
- package/dist/index/index.js +0 -1
- package/dist/index/index.mjs +0 -2736
- package/dist/index.d.ts +0 -18
- package/dist/mulguard.d.ts +0 -373
- package/dist/nextjs/client/hooks.d.ts +0 -122
- package/dist/nextjs/client/index.d.ts +0 -13
- package/dist/nextjs/client/provider.d.ts +0 -69
- package/dist/nextjs/client/server-actions-helper.d.ts +0 -22
- package/dist/nextjs/handlers/api.d.ts +0 -10
- package/dist/nextjs/handlers/index.d.ts +0 -9
- package/dist/nextjs/handlers/route.d.ts +0 -76
- package/dist/nextjs/index.d.ts +0 -15
- package/dist/nextjs/proxy/index.d.ts +0 -149
- package/dist/nextjs/proxy/security.d.ts +0 -9
- package/dist/nextjs/server/actions.d.ts +0 -30
- package/dist/nextjs/server/auth.d.ts +0 -65
- package/dist/nextjs/server/cookies.d.ts +0 -41
- package/dist/nextjs/server/index.d.ts +0 -18
- package/dist/nextjs/server/oauth-state.d.ts +0 -32
- package/dist/nextjs/server/session-helpers.d.ts +0 -24
- package/dist/nextjs/server/session.d.ts +0 -144
- package/dist/oauth-state-Drwz6fES.js +0 -1
- package/dist/oauth-state-pdypStuS.mjs +0 -210
- package/dist/server/index.js +0 -1
- package/dist/server/index.mjs +0 -29
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
import { AuthErrorCode, AuthError as AuthErrorInterface, ErrorResult } from '../types/errors';
|
|
2
|
-
/**
|
|
3
|
-
* Base authentication error class.
|
|
4
|
-
*
|
|
5
|
-
* Extends native Error with authentication-specific properties.
|
|
6
|
-
* All authentication errors should extend this class.
|
|
7
|
-
*
|
|
8
|
-
* @property code - Specific error code
|
|
9
|
-
* @property statusCode - HTTP status code (if applicable)
|
|
10
|
-
* @property details - Additional error details (optional)
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* throw new AuthError(
|
|
15
|
-
* AuthErrorCode.INVALID_CREDENTIALS,
|
|
16
|
-
* 'Invalid email or password'
|
|
17
|
-
* )
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export declare class AuthError extends Error {
|
|
21
|
-
readonly code: AuthErrorCode;
|
|
22
|
-
readonly statusCode: number;
|
|
23
|
-
readonly details?: unknown;
|
|
24
|
-
constructor(code: AuthErrorCode, message: string, statusCode?: number, details?: unknown);
|
|
25
|
-
/**
|
|
26
|
-
* Converts error to plain object for serialization.
|
|
27
|
-
*
|
|
28
|
-
* @returns Plain error object
|
|
29
|
-
*/
|
|
30
|
-
toJSON(): AuthErrorInterface;
|
|
31
|
-
/**
|
|
32
|
-
* Creates error result for failed operations.
|
|
33
|
-
*
|
|
34
|
-
* @returns ErrorResult object
|
|
35
|
-
*/
|
|
36
|
-
toErrorResult(): ErrorResult;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Invalid credentials error.
|
|
40
|
-
*
|
|
41
|
-
* Thrown when email/password authentication fails.
|
|
42
|
-
*/
|
|
43
|
-
export declare class InvalidCredentialsError extends AuthError {
|
|
44
|
-
constructor(message?: string, details?: unknown);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Account locked error.
|
|
48
|
-
*
|
|
49
|
-
* Thrown when account is temporarily locked due to failed attempts.
|
|
50
|
-
*/
|
|
51
|
-
export declare class AccountLockedError extends AuthError {
|
|
52
|
-
constructor(message?: string, unlockAt?: Date, details?: unknown);
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Account inactive error.
|
|
56
|
-
*
|
|
57
|
-
* Thrown when account is inactive or disabled.
|
|
58
|
-
*/
|
|
59
|
-
export declare class AccountInactiveError extends AuthError {
|
|
60
|
-
constructor(message?: string, details?: unknown);
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Two-factor authentication required error.
|
|
64
|
-
*
|
|
65
|
-
* Thrown when 2FA verification is required after initial authentication.
|
|
66
|
-
*/
|
|
67
|
-
export declare class TwoFactorRequiredError extends AuthError {
|
|
68
|
-
readonly email: string;
|
|
69
|
-
readonly userId: string;
|
|
70
|
-
readonly twoFactorMethod?: 'totp' | 'sms' | 'email';
|
|
71
|
-
readonly challengeToken?: string;
|
|
72
|
-
constructor(email: string, userId: string, message?: string, twoFactorMethod?: 'totp' | 'sms' | 'email', challengeToken?: string, details?: unknown);
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Invalid two-factor authentication code error.
|
|
76
|
-
*
|
|
77
|
-
* Thrown when 2FA code verification fails.
|
|
78
|
-
*/
|
|
79
|
-
export declare class InvalidTwoFactorCodeError extends AuthError {
|
|
80
|
-
constructor(message?: string, details?: unknown);
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Session expired error.
|
|
84
|
-
*
|
|
85
|
-
* Thrown when session has expired.
|
|
86
|
-
*/
|
|
87
|
-
export declare class SessionExpiredError extends AuthError {
|
|
88
|
-
constructor(message?: string, details?: unknown);
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Unauthorized error.
|
|
92
|
-
*
|
|
93
|
-
* Thrown when user is not authorized for an operation.
|
|
94
|
-
*/
|
|
95
|
-
export declare class UnauthorizedError extends AuthError {
|
|
96
|
-
constructor(message?: string, details?: unknown);
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Network error.
|
|
100
|
-
*
|
|
101
|
-
* Thrown when network or API communication fails.
|
|
102
|
-
*/
|
|
103
|
-
export declare class NetworkError extends AuthError {
|
|
104
|
-
constructor(message?: string, details?: unknown);
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Validation error.
|
|
108
|
-
*
|
|
109
|
-
* Thrown when input validation fails.
|
|
110
|
-
*/
|
|
111
|
-
export declare class ValidationError extends AuthError {
|
|
112
|
-
readonly fields?: ReadonlyArray<{
|
|
113
|
-
field: string;
|
|
114
|
-
message: string;
|
|
115
|
-
}>;
|
|
116
|
-
constructor(message?: string, fields?: ReadonlyArray<{
|
|
117
|
-
field: string;
|
|
118
|
-
message: string;
|
|
119
|
-
}>, details?: unknown);
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Rate limit error.
|
|
123
|
-
*
|
|
124
|
-
* Thrown when rate limit is exceeded.
|
|
125
|
-
*/
|
|
126
|
-
export declare class RateLimitError extends AuthError {
|
|
127
|
-
readonly retryAfter?: number;
|
|
128
|
-
constructor(message?: string, retryAfter?: number, details?: unknown);
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Creates an authentication error from error code and message.
|
|
132
|
-
*
|
|
133
|
-
* @param code - Error code
|
|
134
|
-
* @param message - Error message
|
|
135
|
-
* @param details - Additional error details (optional)
|
|
136
|
-
* @returns AuthError instance
|
|
137
|
-
*
|
|
138
|
-
* @example
|
|
139
|
-
* ```typescript
|
|
140
|
-
* const error = createError(
|
|
141
|
-
* AuthErrorCode.INVALID_CREDENTIALS,
|
|
142
|
-
* 'Invalid email or password'
|
|
143
|
-
* )
|
|
144
|
-
* ```
|
|
145
|
-
*/
|
|
146
|
-
export declare function createError(code: AuthErrorCode, message: string, details?: unknown): AuthError;
|
|
147
|
-
/**
|
|
148
|
-
* Creates an error result for failed operations.
|
|
149
|
-
*
|
|
150
|
-
* @template TCode - Error code type
|
|
151
|
-
* @param code - Error code
|
|
152
|
-
* @param message - Error message
|
|
153
|
-
* @param details - Additional error details (optional)
|
|
154
|
-
* @returns ErrorResult object
|
|
155
|
-
*
|
|
156
|
-
* @example
|
|
157
|
-
* ```typescript
|
|
158
|
-
* const result = createErrorResult(
|
|
159
|
-
* AuthErrorCode.INVALID_CREDENTIALS,
|
|
160
|
-
* 'Invalid email or password'
|
|
161
|
-
* )
|
|
162
|
-
* ```
|
|
163
|
-
*/
|
|
164
|
-
export declare function createErrorResult<TCode extends AuthErrorCode = AuthErrorCode>(code: TCode, message: string, details?: unknown): ErrorResult<TCode>;
|
|
165
|
-
/**
|
|
166
|
-
* Converts unknown error to AuthError.
|
|
167
|
-
*
|
|
168
|
-
* Handles various error types and converts them to AuthError.
|
|
169
|
-
*
|
|
170
|
-
* @param error - Unknown error value
|
|
171
|
-
* @param defaultCode - Default error code (optional)
|
|
172
|
-
* @param defaultMessage - Default error message (optional)
|
|
173
|
-
* @returns AuthError instance
|
|
174
|
-
*
|
|
175
|
-
* @example
|
|
176
|
-
* ```typescript
|
|
177
|
-
* try {
|
|
178
|
-
* // Some operation
|
|
179
|
-
* } catch (error) {
|
|
180
|
-
* const authError = toAuthError(error, AuthErrorCode.UNKNOWN_ERROR)
|
|
181
|
-
* logger.error('Operation failed', authError)
|
|
182
|
-
* }
|
|
183
|
-
* ```
|
|
184
|
-
*/
|
|
185
|
-
export declare function toAuthError(error: unknown, defaultCode?: AuthErrorCode, defaultMessage?: string): AuthError;
|
|
186
|
-
/**
|
|
187
|
-
* Checks if error is an authentication error.
|
|
188
|
-
*
|
|
189
|
-
* @param error - Error to check
|
|
190
|
-
* @returns True if error is AuthError
|
|
191
|
-
*
|
|
192
|
-
* @example
|
|
193
|
-
* ```typescript
|
|
194
|
-
* if (isAuthError(error)) {
|
|
195
|
-
* // Handle authentication error
|
|
196
|
-
* console.error(error.code, error.message)
|
|
197
|
-
* }
|
|
198
|
-
* ```
|
|
199
|
-
*/
|
|
200
|
-
export declare function isAuthError(error: unknown): error is AuthError;
|
|
201
|
-
/**
|
|
202
|
-
* Gets error message from unknown error.
|
|
203
|
-
*
|
|
204
|
-
* @param error - Error to extract message from
|
|
205
|
-
* @param defaultMessage - Default message if extraction fails
|
|
206
|
-
* @returns Error message string
|
|
207
|
-
*
|
|
208
|
-
* @example
|
|
209
|
-
* ```typescript
|
|
210
|
-
* const message = getErrorMessage(error, 'Unknown error')
|
|
211
|
-
* ```
|
|
212
|
-
*/
|
|
213
|
-
export declare function getErrorMessage(error: unknown, defaultMessage?: string): string;
|
|
214
|
-
/**
|
|
215
|
-
* Gets error code from unknown error.
|
|
216
|
-
*
|
|
217
|
-
* @param error - Error to extract code from
|
|
218
|
-
* @param defaultCode - Default code if extraction fails
|
|
219
|
-
* @returns Error code
|
|
220
|
-
*
|
|
221
|
-
* @example
|
|
222
|
-
* ```typescript
|
|
223
|
-
* const code = getErrorCode(error, AuthErrorCode.UNKNOWN_ERROR)
|
|
224
|
-
* ```
|
|
225
|
-
*/
|
|
226
|
-
export declare function getErrorCode(error: unknown, defaultCode?: AuthErrorCode): AuthErrorCode;
|
|
227
|
-
export { AuthErrorCode, type AuthError as AuthErrorInterface, type ErrorResult, getErrorStatusCode, ERROR_STATUS_MAP, } from '../types/errors';
|
|
228
|
-
/**
|
|
229
|
-
* TODO: Performance
|
|
230
|
-
* - [ ] Add error pooling for high-frequency error creation
|
|
231
|
-
* - [ ] Implement error serialization caching
|
|
232
|
-
* - [ ] Add error aggregation for batch operations
|
|
233
|
-
* - [ ] Consider using Error.cause for error chaining (Node.js 16.9+)
|
|
234
|
-
*
|
|
235
|
-
* TODO: Features
|
|
236
|
-
* - [ ] Add error recovery strategies
|
|
237
|
-
* - [ ] Implement error code hierarchies/categories
|
|
238
|
-
* - [ ] Add localized error messages support
|
|
239
|
-
* - [ ] Create error code to user-friendly message mapping
|
|
240
|
-
* - [ ] Add error code metadata (retryable, transient, etc.)
|
|
241
|
-
* - [ ] Implement error reporting integration (Sentry, etc.)
|
|
242
|
-
* - [ ] Add error context propagation
|
|
243
|
-
*
|
|
244
|
-
* TODO: Type Safety
|
|
245
|
-
* - [ ] Add branded types for error codes
|
|
246
|
-
* - [ ] Implement type-safe error code unions
|
|
247
|
-
* - [ ] Add exhaustiveness checking for error handling
|
|
248
|
-
* - [ ] Create type-safe error code validation
|
|
249
|
-
* - [ ] Add type-level error code to status code mapping
|
|
250
|
-
*
|
|
251
|
-
* TODO: Testing
|
|
252
|
-
* - [ ] Add unit tests for all error classes
|
|
253
|
-
* - [ ] Test error factory functions
|
|
254
|
-
* - [ ] Test error conversion utilities
|
|
255
|
-
* - [ ] Test error serialization
|
|
256
|
-
* - [ ] Add integration tests for error handling flow
|
|
257
|
-
*
|
|
258
|
-
* TODO: Documentation
|
|
259
|
-
* - [ ] Add examples for each error class
|
|
260
|
-
* - [ ] Document error handling best practices
|
|
261
|
-
* - [ ] Create error code reference guide
|
|
262
|
-
* - [ ] Add error handling patterns guide
|
|
263
|
-
*
|
|
264
|
-
* TODO: Limitations
|
|
265
|
-
* - [ ] Error code enum may need extension for custom errors
|
|
266
|
-
* - [ ] Status code mapping is fixed (consider configurable)
|
|
267
|
-
* - [ ] Error details type is unknown (consider generic)
|
|
268
|
-
* - [ ] Stack trace capture may have performance impact
|
|
269
|
-
*/
|
package/dist/core/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core authentication library - framework agnostic
|
|
3
|
-
* Part of mulguard package
|
|
4
|
-
*/
|
|
5
|
-
export type { MulguardConfig, SessionConfig, SecurityConfig, CallbacksConfig, AuthActions, Session, User, AuthResult, EmailCredentials, RegisterData, RequestContext, } from './types';
|
|
6
|
-
export * from './security';
|
|
7
|
-
export * from './utils/auth-helpers';
|
|
8
|
-
export * from './auth/signin-unified';
|
|
9
|
-
export * from './auth/oauth';
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { Logger, LoggerConfig, LogLevel } from '../utils/logger';
|
|
2
|
-
/**
|
|
3
|
-
* Enhanced logging system for Mulguard Authentication Library.
|
|
4
|
-
*
|
|
5
|
-
* Provides structured logging with multiple adapters (Console, Pino) and
|
|
6
|
-
* comprehensive log sanitization for security.
|
|
7
|
-
*
|
|
8
|
-
* @module @mulguard/core/logger
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Logger adapter interface for different logging backends.
|
|
12
|
-
*/
|
|
13
|
-
export interface LoggerAdapter {
|
|
14
|
-
readonly debug: (message: string, data?: Readonly<Record<string, unknown>>) => void;
|
|
15
|
-
readonly info: (message: string, data?: Readonly<Record<string, unknown>>) => void;
|
|
16
|
-
readonly warn: (message: string, data?: Readonly<Record<string, unknown>>) => void;
|
|
17
|
-
readonly error: (message: string, error?: Error | Readonly<Record<string, unknown>>) => void;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Logger adapter type.
|
|
21
|
-
*/
|
|
22
|
-
export type LoggerAdapterType = 'console' | 'pino' | 'custom';
|
|
23
|
-
/**
|
|
24
|
-
* Creates a console-based logger adapter.
|
|
25
|
-
*
|
|
26
|
-
* @param config - Logger configuration
|
|
27
|
-
* @returns Console logger adapter
|
|
28
|
-
*/
|
|
29
|
-
export declare function createConsoleAdapter(config?: LoggerConfig): LoggerAdapter;
|
|
30
|
-
/**
|
|
31
|
-
* Creates a Pino-based logger adapter.
|
|
32
|
-
*
|
|
33
|
-
* Requires 'pino' package to be installed.
|
|
34
|
-
* Falls back to console adapter if Pino is not available.
|
|
35
|
-
*
|
|
36
|
-
* @param config - Logger configuration
|
|
37
|
-
* @returns Pino logger adapter or console fallback
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```typescript
|
|
41
|
-
* const logger = createPinoAdapter({
|
|
42
|
-
* level: 'info',
|
|
43
|
-
* context: 'Auth'
|
|
44
|
-
* })
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
export declare function createPinoAdapter(config?: LoggerConfig): LoggerAdapter;
|
|
48
|
-
/**
|
|
49
|
-
* Enhanced logger configuration with adapter support.
|
|
50
|
-
*/
|
|
51
|
-
export interface EnhancedLoggerConfig {
|
|
52
|
-
readonly adapter?: LoggerAdapterType | LoggerAdapter;
|
|
53
|
-
readonly pinoOptions?: Record<string, unknown>;
|
|
54
|
-
readonly level?: LogLevel;
|
|
55
|
-
readonly context?: string;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Creates an enhanced logger instance with adapter support.
|
|
59
|
-
*
|
|
60
|
-
* @param config - Enhanced logger configuration
|
|
61
|
-
* @returns Logger instance
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```typescript
|
|
65
|
-
* // Console adapter (default)
|
|
66
|
-
* const logger1 = createEnhancedLogger({ level: LogLevel.INFO })
|
|
67
|
-
*
|
|
68
|
-
* // Pino adapter
|
|
69
|
-
* const logger2 = createEnhancedLogger({ adapter: 'pino' })
|
|
70
|
-
*
|
|
71
|
-
* // Custom adapter
|
|
72
|
-
* const logger3 = createEnhancedLogger({ adapter: customAdapter })
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
export declare function createEnhancedLogger(config?: EnhancedLoggerConfig): Logger;
|
|
76
|
-
/**
|
|
77
|
-
* Default enhanced logger instance.
|
|
78
|
-
*
|
|
79
|
-
* Uses console adapter by default, can be configured via environment variables.
|
|
80
|
-
*/
|
|
81
|
-
export declare const logger: Logger;
|
|
82
|
-
/**
|
|
83
|
-
* Creates a logger with context.
|
|
84
|
-
*
|
|
85
|
-
* @param context - Log context
|
|
86
|
-
* @param baseLogger - Base logger instance (optional)
|
|
87
|
-
* @returns Logger with context
|
|
88
|
-
*
|
|
89
|
-
* @example
|
|
90
|
-
* ```typescript
|
|
91
|
-
* const authLogger = createContextLogger('Auth', logger)
|
|
92
|
-
* authLogger.info('User signed in', { userId: '123' })
|
|
93
|
-
* // Output: [Auth] User signed in { userId: '123' }
|
|
94
|
-
* ```
|
|
95
|
-
*/
|
|
96
|
-
export declare function createContextLogger(context: string, baseLogger?: Logger): Logger;
|
|
97
|
-
export type { Logger, LoggerConfig, LogEntry } from '../utils/logger';
|
|
98
|
-
export { LogLevel, createLogger, isLogger } from '../utils/logger';
|
|
99
|
-
/**
|
|
100
|
-
* TODO: Performance
|
|
101
|
-
* - [ ] Add log batching for high-frequency operations
|
|
102
|
-
* - [ ] Implement async logging for non-blocking operations
|
|
103
|
-
* - [ ] Add log rotation and cleanup
|
|
104
|
-
* - [ ] Consider log sampling for high-volume scenarios
|
|
105
|
-
* - [ ] Add log compression for file-based logging
|
|
106
|
-
*
|
|
107
|
-
* TODO: Features
|
|
108
|
-
* - [ ] Add Winston adapter support
|
|
109
|
-
* - [ ] Implement log transport abstraction (file, remote, etc.)
|
|
110
|
-
* - [ ] Add log correlation IDs (request IDs)
|
|
111
|
-
* - [ ] Create log aggregation support
|
|
112
|
-
* - [ ] Add performance metrics logging
|
|
113
|
-
* - [ ] Implement structured logging with schemas
|
|
114
|
-
* - [ ] Add log filtering by context/level
|
|
115
|
-
*
|
|
116
|
-
* TODO: Type Safety
|
|
117
|
-
* - [ ] Add type-safe log data validation
|
|
118
|
-
* - [ ] Create log schema definitions
|
|
119
|
-
* - [ ] Add compile-time log level checking
|
|
120
|
-
* - [ ] Implement type-safe log context
|
|
121
|
-
*
|
|
122
|
-
* TODO: Security
|
|
123
|
-
* - [ ] Enhance sensitive data detection
|
|
124
|
-
* - [ ] Add PII (Personally Identifiable Information) masking
|
|
125
|
-
* - [ ] Implement log encryption for sensitive logs
|
|
126
|
-
* - [ ] Add audit log support
|
|
127
|
-
* - [ ] Add log access control
|
|
128
|
-
*
|
|
129
|
-
* TODO: Testing
|
|
130
|
-
* - [ ] Add logger adapter unit tests
|
|
131
|
-
* - [ ] Test Pino adapter fallback
|
|
132
|
-
* - [ ] Test log sanitization
|
|
133
|
-
* - [ ] Test context logger
|
|
134
|
-
* - [ ] Add performance tests
|
|
135
|
-
*
|
|
136
|
-
* TODO: Documentation
|
|
137
|
-
* - [ ] Document adapter configuration
|
|
138
|
-
* - [ ] Add logging best practices guide
|
|
139
|
-
* - [ ] Document log levels and when to use them
|
|
140
|
-
* - [ ] Create adapter migration guide
|
|
141
|
-
*
|
|
142
|
-
* TODO: Limitations
|
|
143
|
-
* - [ ] Pino adapter requires 'pino' package (optional dependency)
|
|
144
|
-
* - [ ] Dynamic import may have performance impact
|
|
145
|
-
* - [ ] Log sanitization is basic (may need enhancement)
|
|
146
|
-
* - [ ] No log persistence (consider file/remote logging)
|
|
147
|
-
*/
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { AuthResult, EmailCredentials, RegisterData, User, Session, AuthActions, CallbacksConfig } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Authentication handlers configuration.
|
|
4
|
-
*/
|
|
5
|
-
export interface AuthHandlersConfig<TUser extends User = User, TSession extends Session<TUser> = Session<TUser>> {
|
|
6
|
-
readonly actions: AuthActions<TUser, TSession>;
|
|
7
|
-
readonly callbacks: CallbacksConfig;
|
|
8
|
-
readonly saveSessionAfterAuth: (result: AuthResult<TUser, TSession>) => Promise<{
|
|
9
|
-
success: boolean;
|
|
10
|
-
error?: string;
|
|
11
|
-
warning?: string;
|
|
12
|
-
}>;
|
|
13
|
-
readonly onError?: (error: Error, context: string) => Promise<void> | void;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Sign-in handlers result.
|
|
17
|
-
*/
|
|
18
|
-
export interface SignInHandlers<TUser extends User = User, TSession extends Session<TUser> = Session<TUser>> {
|
|
19
|
-
readonly email: (credentials: EmailCredentials) => Promise<AuthResult<TUser, TSession>>;
|
|
20
|
-
readonly oauth?: (provider: string) => Promise<{
|
|
21
|
-
url: string;
|
|
22
|
-
state: string;
|
|
23
|
-
}>;
|
|
24
|
-
readonly passkey?: (options?: {
|
|
25
|
-
userId?: string;
|
|
26
|
-
}) => Promise<AuthResult<TUser, TSession>>;
|
|
27
|
-
readonly otp?: (email: string, code?: string) => Promise<AuthResult<TUser, TSession>>;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Creates unified sign-in handler that supports both provider-based and direct method calls.
|
|
31
|
-
*
|
|
32
|
-
* @template TUser - User type
|
|
33
|
-
* @template TSession - Session type
|
|
34
|
-
* @param config - Handler configuration
|
|
35
|
-
* @param storeOAuthState - Function to store OAuth state
|
|
36
|
-
* @returns Unified sign-in handler
|
|
37
|
-
*/
|
|
38
|
-
export declare function createUnifiedSignInHandler<TUser extends User = User, TSession extends Session<TUser> = Session<TUser>>(config: AuthHandlersConfig<TUser, TSession>, storeOAuthState: (state: string, provider: string) => Promise<void>): SignInHandlers<TUser, TSession> & {
|
|
39
|
-
(provider: string): Promise<{
|
|
40
|
-
url: string;
|
|
41
|
-
state: string;
|
|
42
|
-
}>;
|
|
43
|
-
(provider: 'credentials', credentials: EmailCredentials): Promise<AuthResult<TUser, TSession>>;
|
|
44
|
-
(provider: 'otp', options: {
|
|
45
|
-
email: string;
|
|
46
|
-
code?: string;
|
|
47
|
-
}): Promise<AuthResult<TUser, TSession>>;
|
|
48
|
-
(provider: 'passkey', options?: {
|
|
49
|
-
userId?: string;
|
|
50
|
-
}): Promise<AuthResult<TUser, TSession>>;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Creates sign-up handler.
|
|
54
|
-
*
|
|
55
|
-
* @template TUser - User type
|
|
56
|
-
* @template TSession - Session type
|
|
57
|
-
* @param config - Handler configuration
|
|
58
|
-
* @returns Sign-up handler
|
|
59
|
-
*/
|
|
60
|
-
export declare function createSignUpHandler<TUser extends User = User, TSession extends Session<TUser> = Session<TUser>>(config: AuthHandlersConfig<TUser, TSession>): (data: RegisterData) => Promise<AuthResult<TUser, TSession>>;
|
|
61
|
-
/**
|
|
62
|
-
* TODO: Performance
|
|
63
|
-
* - [ ] Add request deduplication for concurrent sign-in attempts
|
|
64
|
-
* - [ ] Implement rate limiting per email/IP
|
|
65
|
-
* - [ ] Add sign-in attempt caching
|
|
66
|
-
* - [ ] Optimize validation logic
|
|
67
|
-
*
|
|
68
|
-
* TODO: Features
|
|
69
|
-
* - [ ] Add social login account linking
|
|
70
|
-
* - [ ] Implement sign-in with magic link
|
|
71
|
-
* - [ ] Add biometric authentication support
|
|
72
|
-
* - [ ] Create sign-in attempt tracking
|
|
73
|
-
*
|
|
74
|
-
* TODO: Type Safety
|
|
75
|
-
* - [ ] Add runtime validation for all inputs
|
|
76
|
-
* - [ ] Create type-safe credential builders
|
|
77
|
-
* - [ ] Implement compile-time provider validation
|
|
78
|
-
*
|
|
79
|
-
* TODO: Security
|
|
80
|
-
* - [ ] Add CAPTCHA support for repeated failures
|
|
81
|
-
* - [ ] Implement account lockout after failed attempts
|
|
82
|
-
* - [ ] Add device fingerprinting
|
|
83
|
-
* - [ ] Create security event logging
|
|
84
|
-
*
|
|
85
|
-
* TODO: Testing
|
|
86
|
-
* - [ ] Add comprehensive handler tests
|
|
87
|
-
* - [ ] Test all validation scenarios
|
|
88
|
-
* - [ ] Test error handling
|
|
89
|
-
* - [ ] Add integration tests
|
|
90
|
-
*
|
|
91
|
-
* TODO: Documentation
|
|
92
|
-
* - [ ] Document all sign-in methods
|
|
93
|
-
* - [ ] Add usage examples
|
|
94
|
-
* - [ ] Create troubleshooting guide
|
|
95
|
-
*
|
|
96
|
-
* TODO: Limitations
|
|
97
|
-
* - [ ] Input validation is basic (consider schema validation)
|
|
98
|
-
* - [ ] No support for custom validation rules
|
|
99
|
-
* - [ ] Error messages may be too generic
|
|
100
|
-
*/
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { SessionConfig } from '../types';
|
|
2
|
-
import { TokenRefreshConfig } from '../client/token-refresh-manager';
|
|
3
|
-
/**
|
|
4
|
-
* Default session configuration.
|
|
5
|
-
*
|
|
6
|
-
* Auto-detects environment and applies secure defaults.
|
|
7
|
-
*
|
|
8
|
-
* @returns Default session configuration
|
|
9
|
-
*/
|
|
10
|
-
export declare function getDefaultSessionConfig(): SessionConfig;
|
|
11
|
-
/**
|
|
12
|
-
* Default token refresh configuration.
|
|
13
|
-
*
|
|
14
|
-
* Optimized to prevent infinite loops and improve performance.
|
|
15
|
-
*
|
|
16
|
-
* @returns Default token refresh configuration
|
|
17
|
-
*/
|
|
18
|
-
export declare function getDefaultTokenRefreshConfig(): TokenRefreshConfig;
|
|
19
|
-
/**
|
|
20
|
-
* Gets the base URL for OAuth redirects.
|
|
21
|
-
*
|
|
22
|
-
* Detects the base URL from environment variables or defaults to localhost.
|
|
23
|
-
*
|
|
24
|
-
* @returns Base URL string
|
|
25
|
-
*/
|
|
26
|
-
export declare function getBaseUrl(): string;
|
|
27
|
-
/**
|
|
28
|
-
* TODO: Performance
|
|
29
|
-
* - [ ] Cache base URL detection result
|
|
30
|
-
* - [ ] Add configuration validation at startup
|
|
31
|
-
* - [ ] Implement configuration hot-reload support
|
|
32
|
-
*
|
|
33
|
-
* TODO: Features
|
|
34
|
-
* - [ ] Add environment-specific configuration presets
|
|
35
|
-
* - [ ] Create configuration builder pattern
|
|
36
|
-
* - [ ] Add configuration schema validation
|
|
37
|
-
* - [ ] Implement configuration inheritance
|
|
38
|
-
*
|
|
39
|
-
* TODO: Type Safety
|
|
40
|
-
* - [ ] Add type-level validation for configuration values
|
|
41
|
-
* - [ ] Create branded types for configuration
|
|
42
|
-
* - [ ] Implement compile-time configuration checking
|
|
43
|
-
*
|
|
44
|
-
* TODO: Testing
|
|
45
|
-
* - [ ] Add tests for default configurations
|
|
46
|
-
* - [ ] Test environment detection
|
|
47
|
-
* - [ ] Test configuration merging
|
|
48
|
-
*
|
|
49
|
-
* TODO: Documentation
|
|
50
|
-
* - [ ] Document all default values
|
|
51
|
-
* - [ ] Add configuration examples
|
|
52
|
-
* - [ ] Create configuration reference guide
|
|
53
|
-
*
|
|
54
|
-
* TODO: Limitations
|
|
55
|
-
* - [ ] Base URL detection is basic (consider more sophisticated detection)
|
|
56
|
-
* - [ ] No configuration validation at runtime
|
|
57
|
-
* - [ ] Defaults are fixed (consider configurable defaults)
|
|
58
|
-
*/
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { MulguardConfig, User, Session, EmailCredentials } from '../types';
|
|
2
|
-
import { SecurityManager } from '../security/security-manager';
|
|
3
|
-
import { SessionManager as CoreSessionManager } from '../session/session-manager';
|
|
4
|
-
import { EmailPasswordAuth } from '../auth/email-password';
|
|
5
|
-
import { OTPAuth } from '../auth/otp';
|
|
6
|
-
import { OAuthHandler } from '../auth/oauth/oauth-handler';
|
|
7
|
-
import { Logger } from '../logger';
|
|
8
|
-
/**
|
|
9
|
-
* Core modules integration configuration.
|
|
10
|
-
*/
|
|
11
|
-
export interface CoreModulesIntegrationConfig<TUser extends User = User, TSession extends Session<TUser> = Session<TUser>> {
|
|
12
|
-
readonly config: MulguardConfig<TUser, TSession>;
|
|
13
|
-
readonly baseUrl: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Integrated core modules instance.
|
|
17
|
-
*/
|
|
18
|
-
export interface IntegratedCoreModules {
|
|
19
|
-
readonly security: SecurityManager;
|
|
20
|
-
readonly session: CoreSessionManager;
|
|
21
|
-
readonly emailPassword: EmailPasswordAuth;
|
|
22
|
-
readonly otp: OTPAuth;
|
|
23
|
-
readonly oauth: OAuthHandler | null;
|
|
24
|
-
readonly logger: Logger;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Creates integrated core modules for Mulguard instance.
|
|
28
|
-
*
|
|
29
|
-
* Initializes and configures all core modules with proper dependencies.
|
|
30
|
-
*
|
|
31
|
-
* @template TUser - User type
|
|
32
|
-
* @template TSession - Session type
|
|
33
|
-
* @param integrationConfig - Integration configuration
|
|
34
|
-
* @returns Integrated core modules
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```typescript
|
|
38
|
-
* const modules = createCoreModulesIntegration({
|
|
39
|
-
* config: mulguardConfig,
|
|
40
|
-
* baseUrl: 'https://example.com',
|
|
41
|
-
* })
|
|
42
|
-
*
|
|
43
|
-
* // Use modules.security, modules.session, etc.
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
export declare function createCoreModulesIntegration<TUser extends User = User, TSession extends Session<TUser> = Session<TUser>>(integrationConfig: CoreModulesIntegrationConfig<TUser, TSession>): IntegratedCoreModules;
|
|
47
|
-
/**
|
|
48
|
-
* Creates a wrapper for custom email/password action that uses EmailPasswordAuth.
|
|
49
|
-
*
|
|
50
|
-
* @template TUser - User type
|
|
51
|
-
* @template TSession - Session type
|
|
52
|
-
* @param emailPassword - EmailPasswordAuth instance
|
|
53
|
-
* @param customAction - Custom action from config
|
|
54
|
-
* @returns Wrapped action that uses EmailPasswordAuth for validation
|
|
55
|
-
*/
|
|
56
|
-
export declare function wrapEmailPasswordAction<TUser extends User = User, TSession extends Session<TUser> = Session<TUser>>(emailPassword: EmailPasswordAuth, customAction: (credentials: EmailCredentials) => Promise<import('../types').AuthResult<TUser, TSession>>): (credentials: EmailCredentials) => Promise<import('../types').AuthResult<TUser, TSession>>;
|
|
57
|
-
/**
|
|
58
|
-
* Creates a wrapper for custom OTP action that uses OTPAuth.
|
|
59
|
-
*
|
|
60
|
-
* @template TUser - User type
|
|
61
|
-
* @template TSession - Session type
|
|
62
|
-
* @param otp - OTPAuth instance
|
|
63
|
-
* @param customAction - Custom action from config
|
|
64
|
-
* @returns Wrapped action that uses OTPAuth for validation
|
|
65
|
-
*/
|
|
66
|
-
export declare function wrapOTPAction<TUser extends User = User, TSession extends Session<TUser> = Session<TUser>>(otp: OTPAuth, customAction: (email: string, code?: string) => Promise<import('../types').AuthResult<TUser, TSession>>): (email: string, code?: string) => Promise<import('../types').AuthResult<TUser, TSession>>;
|
|
67
|
-
export type { SecurityManager, SecurityConfig } from '../security/security-manager';
|
|
68
|
-
export type { SessionManager, SessionManagerConfig } from '../session/session-manager';
|
|
69
|
-
export type { EmailPasswordAuth, EmailPasswordConfig } from '../auth/email-password';
|
|
70
|
-
export type { OTPAuth, OTPConfig } from '../auth/otp';
|
|
71
|
-
export type { OAuthHandler, OAuthHandlerConfig } from '../auth/oauth/oauth-handler';
|
|
72
|
-
/**
|
|
73
|
-
* TODO: Performance
|
|
74
|
-
* - [ ] Add module initialization caching
|
|
75
|
-
* - [ ] Optimize module dependency resolution
|
|
76
|
-
* - [ ] Add lazy module loading
|
|
77
|
-
* - [ ] Implement module pooling
|
|
78
|
-
*
|
|
79
|
-
* TODO: Features
|
|
80
|
-
* - [ ] Add module health checks
|
|
81
|
-
* - [ ] Implement module reloading
|
|
82
|
-
* - [ ] Create module dependency graph
|
|
83
|
-
* - [ ] Add module metrics collection
|
|
84
|
-
*
|
|
85
|
-
* TODO: Type Safety
|
|
86
|
-
* - [ ] Add type-safe module configuration
|
|
87
|
-
* - [ ] Create compile-time module validation
|
|
88
|
-
* - [ ] Implement type-level dependency checking
|
|
89
|
-
*
|
|
90
|
-
* TODO: Testing
|
|
91
|
-
* - [ ] Add integration tests for module initialization
|
|
92
|
-
* - [ ] Test module dependency resolution
|
|
93
|
-
* - [ ] Test module error handling
|
|
94
|
-
*
|
|
95
|
-
* TODO: Documentation
|
|
96
|
-
* - [ ] Document module integration flow
|
|
97
|
-
* - [ ] Add module configuration guide
|
|
98
|
-
* - [ ] Create module troubleshooting guide
|
|
99
|
-
*
|
|
100
|
-
* TODO: Limitations
|
|
101
|
-
* - [ ] Module initialization is synchronous (consider async initialization)
|
|
102
|
-
* - [ ] No module dependency validation at runtime
|
|
103
|
-
* - [ ] Module configuration is fixed (consider dynamic configuration)
|
|
104
|
-
*/
|