@baseplate-dev/plugin-auth 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/core/components/auth-definition-editor.d.ts.map +1 -1
- package/dist/auth/core/components/auth-definition-editor.js +8 -5
- package/dist/auth/core/components/auth-definition-editor.js.map +1 -1
- package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.d.ts +28 -0
- package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.js +43 -0
- package/dist/auth/core/generators/auth-apollo/auth-apollo.generator.js.map +1 -0
- package/dist/auth/core/generators/auth-apollo/index.d.ts +2 -0
- package/dist/auth/core/generators/auth-apollo/index.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-apollo/index.js +2 -0
- package/dist/auth/core/generators/auth-apollo/index.js.map +1 -0
- package/dist/auth/core/generators/auth-apollo/templates/session-error-link.d.ts +2 -0
- package/dist/auth/core/generators/auth-apollo/templates/session-error-link.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-apollo/templates/session-error-link.js +15 -0
- package/dist/auth/core/generators/auth-apollo/templates/session-error-link.js.map +1 -0
- package/dist/auth/core/generators/auth-apollo/templates/session-error-link.ts +16 -0
- package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.d.ts +73 -0
- package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.js +40 -0
- package/dist/auth/core/generators/auth-email-password/auth-email-password.generator.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/index.d.ts +120 -0
- package/dist/auth/core/generators/auth-email-password/generated/index.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/index.js +11 -0
- package/dist/auth/core/generators/auth-email-password/generated/index.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/template-paths.d.ts +14 -0
- package/dist/auth/core/generators/auth-email-password/generated/template-paths.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/template-paths.js +26 -0
- package/dist/auth/core/generators/auth-email-password/generated/template-paths.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/template-renderers.d.ts +58 -0
- package/dist/auth/core/generators/auth-email-password/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/template-renderers.js +54 -0
- package/dist/auth/core/generators/auth-email-password/generated/template-renderers.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts +25 -0
- package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.js +32 -0
- package/dist/auth/core/generators/auth-email-password/generated/ts-import-providers.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/typed-templates.d.ts +97 -0
- package/dist/auth/core/generators/auth-email-password/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/generated/typed-templates.js +56 -0
- package/dist/auth/core/generators/auth-email-password/generated/typed-templates.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/index.d.ts +4 -0
- package/dist/auth/core/generators/auth-email-password/index.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/index.js +3 -0
- package/dist/auth/core/generators/auth-email-password/index.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts +2 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.js +3 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts +3 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.d.ts +2 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js +33 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.ts +45 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts +21 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.js +74 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.js.map +1 -0
- package/dist/auth/core/generators/auth-email-password/templates/module/services/user-password.service.ts +122 -0
- package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.d.ts +62 -0
- package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.js +38 -0
- package/dist/auth/core/generators/auth-hooks/auth-hooks.generator.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/index.d.ts +120 -0
- package/dist/auth/core/generators/auth-hooks/generated/index.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/index.js +11 -0
- package/dist/auth/core/generators/auth-hooks/generated/index.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/template-paths.d.ts +16 -0
- package/dist/auth/core/generators/auth-hooks/generated/template-paths.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/template-paths.js +26 -0
- package/dist/auth/core/generators/auth-hooks/generated/template-paths.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/template-renderers.d.ts +47 -0
- package/dist/auth/core/generators/auth-hooks/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/template-renderers.js +49 -0
- package/dist/auth/core/generators/auth-hooks/generated/template-renderers.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts +16 -0
- package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.js +27 -0
- package/dist/auth/core/generators/auth-hooks/generated/ts-import-providers.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/typed-templates.d.ts +116 -0
- package/dist/auth/core/generators/auth-hooks/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/generated/typed-templates.js +70 -0
- package/dist/auth/core/generators/auth-hooks/generated/typed-templates.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/index.d.ts +2 -0
- package/dist/auth/core/generators/auth-hooks/index.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/index.js +2 -0
- package/dist/auth/core/generators/auth-hooks/index.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.d.ts +18 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.gql +10 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.js +22 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-current-user.ts +40 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts +2 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js +27 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.ts +29 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts +8 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.js +12 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-session.ts +16 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts +7 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js +15 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js.map +1 -0
- package/dist/auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.ts +16 -0
- package/dist/auth/{generators/fastify → core/generators}/auth-module/auth-module.generator.d.ts +45 -32
- package/dist/auth/core/generators/auth-module/auth-module.generator.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/auth-module.generator.js +61 -0
- package/dist/auth/core/generators/auth-module/auth-module.generator.js.map +1 -0
- package/dist/auth/core/generators/auth-module/generated/index.d.ts +173 -0
- package/dist/auth/core/generators/auth-module/generated/index.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/generated/index.js +11 -0
- package/dist/auth/core/generators/auth-module/generated/index.js.map +1 -0
- package/dist/auth/core/generators/auth-module/generated/template-paths.d.ts +19 -0
- package/dist/auth/core/generators/auth-module/generated/template-paths.d.ts.map +1 -0
- package/dist/auth/{generators/fastify → core/generators}/auth-module/generated/template-paths.js +10 -7
- package/dist/auth/core/generators/auth-module/generated/template-paths.js.map +1 -0
- package/dist/auth/core/generators/auth-module/generated/template-renderers.d.ts +80 -0
- package/dist/auth/core/generators/auth-module/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/generated/template-renderers.js +77 -0
- package/dist/auth/core/generators/auth-module/generated/template-renderers.js.map +1 -0
- package/dist/auth/core/generators/auth-module/generated/ts-import-providers.d.ts +22 -0
- package/dist/auth/core/generators/auth-module/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/generated/ts-import-providers.js +31 -0
- package/dist/auth/core/generators/auth-module/generated/ts-import-providers.js.map +1 -0
- package/dist/auth/{generators/fastify → core/generators}/auth-module/generated/typed-templates.d.ts +47 -7
- package/dist/auth/core/generators/auth-module/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth/{generators/fastify → core/generators}/auth-module/generated/typed-templates.js +40 -3
- package/dist/auth/core/generators/auth-module/generated/typed-templates.js.map +1 -0
- package/dist/auth/core/generators/auth-module/index.d.ts +4 -0
- package/dist/auth/core/generators/auth-module/index.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/index.js +3 -0
- package/dist/auth/core/generators/auth-module/index.js.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/constants/user-session.constants.d.ts +16 -0
- package/dist/auth/core/generators/auth-module/templates/module/constants/user-session.constants.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/constants/user-session.constants.js +17 -0
- package/dist/auth/core/generators/auth-module/templates/module/constants/user-session.constants.js.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.d.ts +2 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js +17 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.ts +23 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.d.ts +2 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js +18 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.ts +23 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.d.ts +2 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.js +19 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.js.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.ts +24 -0
- package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.d.ts +43 -0
- package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.js +180 -0
- package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.js.map +1 -0
- package/dist/auth/{generators/fastify → core/generators}/auth-module/templates/module/services/user-session.service.ts +1 -1
- package/dist/auth/core/generators/auth-module/templates/module/utils/cookie-signer.d.ts +38 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/cookie-signer.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/cookie-signer.js +71 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/cookie-signer.js.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.d.ts +11 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.js +38 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/session-cookie.js.map +1 -0
- package/dist/auth/{generators/fastify → core/generators}/auth-module/templates/module/utils/session-cookie.ts +2 -2
- package/dist/auth/core/generators/auth-module/templates/module/utils/verify-request-origin.d.ts +10 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/verify-request-origin.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/verify-request-origin.js +35 -0
- package/dist/auth/core/generators/auth-module/templates/module/utils/verify-request-origin.js.map +1 -0
- package/dist/{auth0/generators/react/auth0-components/auth0-components.generator.d.ts → auth/core/generators/auth-routes/auth-routes.generator.d.ts} +50 -20
- package/dist/auth/core/generators/auth-routes/auth-routes.generator.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/auth-routes.generator.js +38 -0
- package/dist/auth/core/generators/auth-routes/auth-routes.generator.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/generated/index.d.ts +498 -0
- package/dist/{auth0/generators/react/auth0-callback → auth/core/generators/auth-routes}/generated/index.d.ts.map +1 -1
- package/dist/auth/core/generators/auth-routes/generated/index.js +9 -0
- package/dist/auth/core/generators/auth-routes/generated/index.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/generated/template-paths.d.ts +15 -0
- package/dist/auth/core/generators/auth-routes/generated/template-paths.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/generated/template-paths.js +25 -0
- package/dist/auth/core/generators/auth-routes/generated/template-paths.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/generated/template-renderers.d.ts +177 -0
- package/dist/auth/core/generators/auth-routes/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/generated/template-renderers.js +55 -0
- package/dist/auth/core/generators/auth-routes/generated/template-renderers.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/generated/typed-templates.d.ts +642 -0
- package/dist/auth/core/generators/auth-routes/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/generated/typed-templates.js +57 -0
- package/dist/auth/core/generators/auth-routes/generated/typed-templates.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/index.d.ts +2 -0
- package/dist/auth/core/generators/auth-routes/index.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/index.js +2 -0
- package/dist/auth/core/generators/auth-routes/index.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts +2 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.js +85 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/login.tsx +161 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/queries.gql +15 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts +2 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.js +77 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/register.tsx +148 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts +2 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts.map +1 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.js +10 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.js.map +1 -0
- package/dist/auth/core/generators/auth-routes/templates/routes/auth_/route.tsx +17 -0
- package/dist/auth/core/generators/index.d.ts +8 -0
- package/dist/auth/core/generators/index.d.ts.map +1 -0
- package/dist/auth/core/generators/index.js +8 -0
- package/dist/auth/core/generators/index.js.map +1 -0
- package/dist/auth/core/generators/react-auth/index.d.ts +2 -0
- package/dist/auth/core/generators/react-auth/index.d.ts.map +1 -0
- package/dist/auth/core/generators/react-auth/index.js +2 -0
- package/dist/auth/core/generators/react-auth/index.js.map +1 -0
- package/dist/auth/core/generators/react-auth/react-auth.generator.d.ts +9 -0
- package/dist/auth/core/generators/react-auth/react-auth.generator.d.ts.map +1 -0
- package/dist/auth/core/generators/react-auth/react-auth.generator.js +31 -0
- package/dist/auth/core/generators/react-auth/react-auth.generator.js.map +1 -0
- package/dist/auth/core/generators/react-session/generated/index.d.ts +67 -0
- package/dist/auth/core/generators/react-session/generated/index.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/generated/index.js +11 -0
- package/dist/auth/core/generators/react-session/generated/index.js.map +1 -0
- package/dist/auth/core/generators/react-session/generated/template-paths.d.ts +16 -0
- package/dist/auth/core/generators/react-session/generated/template-paths.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/generated/template-paths.js +26 -0
- package/dist/auth/core/generators/react-session/generated/template-paths.js.map +1 -0
- package/dist/auth/core/generators/react-session/generated/template-renderers.d.ts +27 -0
- package/dist/auth/core/generators/react-session/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/generated/template-renderers.js +48 -0
- package/dist/auth/core/generators/react-session/generated/template-renderers.js.map +1 -0
- package/dist/auth/core/generators/react-session/generated/ts-import-providers.d.ts +64 -0
- package/dist/auth/core/generators/react-session/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/generated/ts-import-providers.js +42 -0
- package/dist/auth/core/generators/react-session/generated/ts-import-providers.js.map +1 -0
- package/dist/auth/core/generators/react-session/generated/typed-templates.d.ts +32 -0
- package/dist/auth/core/generators/react-session/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/generated/typed-templates.js +76 -0
- package/dist/auth/core/generators/react-session/generated/typed-templates.js.map +1 -0
- package/dist/auth/core/generators/react-session/index.d.ts +4 -0
- package/dist/auth/core/generators/react-session/index.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/index.js +3 -0
- package/dist/auth/core/generators/react-session/index.js.map +1 -0
- package/dist/auth/core/generators/react-session/react-session.generator.d.ts +49 -0
- package/dist/auth/core/generators/react-session/react-session.generator.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/react-session.generator.js +39 -0
- package/dist/auth/core/generators/react-session/react-session.generator.js.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.d.ts +7 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.gql +6 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.js +25 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.js.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-check.tsx +29 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.d.ts +7 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.js +18 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.js.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.tsx +47 -0
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.d.ts +12 -0
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.js +15 -0
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.js.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.ts +33 -0
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.d.ts +79 -0
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.d.ts.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.js +133 -0
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.js.map +1 -0
- package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.ts +153 -0
- package/dist/auth/core/index.d.ts +2 -0
- package/dist/auth/core/index.d.ts.map +1 -0
- package/dist/auth/core/index.js +2 -0
- package/dist/auth/core/index.js.map +1 -0
- package/dist/auth/core/node.d.ts.map +1 -1
- package/dist/auth/core/node.js +29 -24
- package/dist/auth/core/node.js.map +1 -1
- package/dist/auth/core/schema/models.d.ts.map +1 -1
- package/dist/auth/core/schema/models.js +15 -10
- package/dist/auth/core/schema/models.js.map +1 -1
- package/dist/auth/core/schema/plugin-definition.js +1 -1
- package/dist/auth/core/schema/plugin-definition.js.map +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/auth0/core/components/auth-definition-editor.d.ts.map +1 -1
- package/dist/auth0/core/components/auth-definition-editor.js +7 -4
- package/dist/auth0/core/components/auth-definition-editor.js.map +1 -1
- package/dist/auth0/core/node.d.ts.map +1 -1
- package/dist/auth0/core/node.js +19 -46
- package/dist/auth0/core/node.js.map +1 -1
- package/dist/auth0/core/schema/plugin-definition.js +1 -1
- package/dist/auth0/core/schema/plugin-definition.js.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts +0 -1
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js +2 -4
- package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/index.d.ts +5 -5
- package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.d.ts +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.js +5 -5
- package/dist/auth0/generators/react/auth0-hooks/generated/template-paths.js.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.d.ts +4 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.js +8 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.js.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.d.ts +5 -5
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.js +6 -6
- package/dist/auth0/generators/react/auth0-hooks/generated/typed-templates.js.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/{useCurrentUser.ts → use-current-user.ts} +4 -3
- package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/{useRequiredUserId.ts → use-required-user-id.ts} +1 -1
- package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/{useSession.ts → use-session.ts} +2 -2
- package/dist/auth0/generators/react/{auth0-callback/auth0-callback.generator.d.ts → auth0-pages/auth0-pages.generator.d.ts} +18 -27
- package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.js +26 -0
- package/dist/auth0/generators/react/auth0-pages/auth0-pages.generator.js.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/generated/index.d.ts +280 -0
- package/dist/auth0/generators/react/{auth0-components → auth0-pages}/generated/index.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-pages/generated/index.js +9 -0
- package/dist/auth0/generators/react/auth0-pages/generated/index.js.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/generated/template-paths.d.ts +12 -0
- package/dist/auth0/generators/react/auth0-pages/generated/template-paths.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/generated/template-paths.js +20 -0
- package/dist/auth0/generators/react/auth0-pages/generated/template-paths.js.map +1 -0
- package/dist/auth0/generators/react/{auth0-components → auth0-pages}/generated/template-renderers.d.ts +16 -16
- package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.js +37 -0
- package/dist/auth0/generators/react/auth0-pages/generated/template-renderers.js.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.d.ts +265 -0
- package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth0/generators/react/{auth0-components → auth0-pages}/generated/typed-templates.js +6 -5
- package/dist/auth0/generators/react/auth0-pages/generated/typed-templates.js.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/index.d.ts +2 -0
- package/dist/auth0/generators/react/auth0-pages/index.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/index.js +2 -0
- package/dist/auth0/generators/react/auth0-pages/index.js.map +1 -0
- package/dist/auth0/generators/react/auth0-pages/templates/routes/login.tsx +31 -0
- package/dist/auth0/generators/react/index.d.ts +1 -2
- package/dist/auth0/generators/react/index.d.ts.map +1 -1
- package/dist/auth0/generators/react/index.js +1 -2
- package/dist/auth0/generators/react/index.js.map +1 -1
- package/dist/auth0/generators/react/{auth0-components → react-auth0}/generated/index.d.ts +31 -30
- package/dist/auth0/generators/react/react-auth0/generated/index.d.ts.map +1 -0
- package/dist/auth0/generators/react/react-auth0/generated/index.js +9 -0
- package/dist/auth0/generators/react/react-auth0/generated/index.js.map +1 -0
- package/dist/auth0/generators/react/react-auth0/generated/template-paths.d.ts +12 -0
- package/dist/auth0/generators/react/react-auth0/generated/template-paths.d.ts.map +1 -0
- package/dist/auth0/generators/react/react-auth0/generated/template-paths.js +22 -0
- package/dist/auth0/generators/react/react-auth0/generated/template-paths.js.map +1 -0
- package/dist/auth0/generators/react/{auth0-callback → react-auth0}/generated/template-renderers.d.ts +15 -27
- package/dist/auth0/generators/react/react-auth0/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth0/generators/react/react-auth0/generated/template-renderers.js +39 -0
- package/dist/auth0/generators/react/react-auth0/generated/template-renderers.js.map +1 -0
- package/dist/auth0/generators/react/{auth0-components → react-auth0}/generated/typed-templates.d.ts +14 -9
- package/dist/auth0/generators/react/react-auth0/generated/typed-templates.d.ts.map +1 -0
- package/dist/auth0/generators/react/react-auth0/generated/typed-templates.js +17 -0
- package/dist/auth0/generators/react/react-auth0/generated/typed-templates.js.map +1 -0
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts +159 -3
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts.map +1 -1
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.js +56 -13
- package/dist/auth0/generators/react/react-auth0/react-auth0.generator.js.map +1 -1
- package/dist/auth0/generators/react/react-auth0/templates/src/app/auth-loaded-gate.tsx +78 -0
- package/dist/common/compiler/generator-creators.d.ts +18 -0
- package/dist/common/compiler/generator-creators.d.ts.map +1 -0
- package/dist/common/compiler/generator-creators.js +34 -0
- package/dist/common/compiler/generator-creators.js.map +1 -0
- package/dist/common/compiler/index.d.ts +2 -0
- package/dist/common/compiler/index.d.ts.map +1 -0
- package/dist/common/compiler/index.js +2 -0
- package/dist/common/compiler/index.js.map +1 -0
- package/dist/common/index.d.ts +3 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +3 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/roles/components/index.d.ts +2 -0
- package/dist/common/roles/components/index.d.ts.map +1 -0
- package/dist/common/roles/components/index.js +2 -0
- package/dist/common/roles/components/index.js.map +1 -0
- package/dist/{auth0/core/components → common/roles/components/role-editor-form}/role-dialog.d.ts +1 -1
- package/dist/common/roles/components/role-editor-form/role-dialog.d.ts.map +1 -0
- package/dist/{auth0/core/components → common/roles/components/role-editor-form}/role-dialog.js +1 -1
- package/dist/common/roles/components/role-editor-form/role-dialog.js.map +1 -0
- package/dist/common/roles/components/role-editor-form/role-editor-form.d.ts +10 -0
- package/dist/common/roles/components/role-editor-form/role-editor-form.d.ts.map +1 -0
- package/dist/{auth0/core/components → common/roles/components/role-editor-form}/role-editor-form.js +5 -8
- package/dist/common/roles/components/role-editor-form/role-editor-form.js.map +1 -0
- package/dist/common/roles/constants.d.ts.map +1 -0
- package/dist/common/roles/constants.js.map +1 -0
- package/dist/common/roles/index.d.ts +4 -0
- package/dist/common/roles/index.d.ts.map +1 -0
- package/dist/common/roles/index.js +4 -0
- package/dist/common/roles/index.js.map +1 -0
- package/dist/common/roles/schema.d.ts.map +1 -0
- package/dist/common/roles/schema.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/placeholder-auth/core/common.d.ts +8 -0
- package/dist/placeholder-auth/core/common.d.ts.map +1 -0
- package/dist/placeholder-auth/core/common.js +26 -0
- package/dist/placeholder-auth/core/common.js.map +1 -0
- package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.d.ts +5 -0
- package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.d.ts.map +1 -0
- package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.js +58 -0
- package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.js.map +1 -0
- package/dist/placeholder-auth/core/generators/index.d.ts +4 -0
- package/dist/placeholder-auth/core/generators/index.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/index.js +4 -0
- package/dist/placeholder-auth/core/generators/index.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.d.ts +51 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.js +11 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.d.ts +16 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.js +28 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.d.ts +24 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.js +46 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.d.ts +16 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.js +27 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.d.ts +24 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.js +68 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/index.d.ts +2 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/index.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/index.js +2 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/index.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.d.ts +39 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.js +38 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.d.ts +14 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.gql +10 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.js +23 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-current-user.ts +35 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.d.ts +5 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.js +8 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.ts +8 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.d.ts +9 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.js +8 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.ts +13 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts +5 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.js +13 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.ts +14 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.d.ts +45 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.js +27 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.d.ts +75 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.js +11 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-paths.d.ts +12 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-paths.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-paths.js +24 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-paths.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.d.ts +39 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.js +41 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.js.map +1 -0
- package/dist/{auth/generators/fastify/auth-module → placeholder-auth/core/generators/placeholder-auth-module}/generated/ts-import-providers.d.ts +2 -2
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/{auth/generators/fastify/auth-module → placeholder-auth/core/generators/placeholder-auth-module}/generated/ts-import-providers.js +5 -5
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/ts-import-providers.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.d.ts +26 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.js +20 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/index.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/index.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.d.ts +23 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.js +29 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.ts +41 -0
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/index.d.ts +2 -0
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/index.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/index.js +2 -0
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/index.js.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/react-auth.generator.d.ts +9 -0
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/react-auth.generator.d.ts.map +1 -0
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/react-auth.generator.js +31 -0
- package/dist/placeholder-auth/core/generators/placeholder-react-auth/react-auth.generator.js.map +1 -0
- package/dist/placeholder-auth/core/index.d.ts +2 -0
- package/dist/placeholder-auth/core/index.d.ts.map +1 -0
- package/dist/placeholder-auth/core/index.js +2 -0
- package/dist/placeholder-auth/core/index.js.map +1 -0
- package/dist/placeholder-auth/core/node.d.ts +5 -0
- package/dist/placeholder-auth/core/node.d.ts.map +1 -0
- package/dist/placeholder-auth/core/node.js +46 -0
- package/dist/placeholder-auth/core/node.js.map +1 -0
- package/dist/placeholder-auth/core/schema/models.d.ts +6 -0
- package/dist/placeholder-auth/core/schema/models.d.ts.map +1 -0
- package/dist/placeholder-auth/core/schema/models.js +35 -0
- package/dist/placeholder-auth/core/schema/models.js.map +1 -0
- package/dist/placeholder-auth/core/schema/plugin-definition.d.ts +82 -0
- package/dist/placeholder-auth/core/schema/plugin-definition.d.ts.map +1 -0
- package/dist/placeholder-auth/core/schema/plugin-definition.js +17 -0
- package/dist/placeholder-auth/core/schema/plugin-definition.js.map +1 -0
- package/dist/placeholder-auth/core/web.d.ts +6 -0
- package/dist/placeholder-auth/core/web.d.ts.map +1 -0
- package/dist/placeholder-auth/core/web.js +14 -0
- package/dist/placeholder-auth/core/web.js.map +1 -0
- package/dist/placeholder-auth/index.d.ts +2 -0
- package/dist/placeholder-auth/index.d.ts.map +1 -0
- package/dist/placeholder-auth/index.js +2 -0
- package/dist/placeholder-auth/index.js.map +1 -0
- package/dist/placeholder-auth/metadata.json +9 -0
- package/dist/placeholder-auth/static/icon.svg +1 -0
- package/dist/web/assets/{__federation_expose_auth0CoreCommon-BYomLcgs.js → __federation_expose_auth0CoreCommon-DcWFsNod.js} +3 -3
- package/dist/web/assets/{__federation_expose_auth0CoreCommon-BYomLcgs.js.map → __federation_expose_auth0CoreCommon-DcWFsNod.js.map} +1 -1
- package/dist/web/assets/__federation_expose_auth0CoreWeb-BrPTg7eC.js +201 -0
- package/dist/web/assets/__federation_expose_auth0CoreWeb-BrPTg7eC.js.map +1 -0
- package/dist/web/assets/{__federation_expose_authCoreCommon-CvirZ1-l.js → __federation_expose_authCoreCommon-20XIFvpM.js} +3 -3
- package/dist/web/assets/{__federation_expose_authCoreCommon-CvirZ1-l.js.map → __federation_expose_authCoreCommon-20XIFvpM.js.map} +1 -1
- package/dist/web/assets/{__federation_expose_authCoreWeb-BXQrtVzN.js → __federation_expose_authCoreWeb-BB5P8uYV.js} +49 -93
- package/dist/web/assets/__federation_expose_authCoreWeb-BB5P8uYV.js.map +1 -0
- package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-Jwt0q3ST.js +39 -0
- package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-Jwt0q3ST.js.map +1 -0
- package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-_Y4pVvZX.js +197 -0
- package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-_Y4pVvZX.js.map +1 -0
- package/dist/web/assets/{__federation_fn_import-5oUmvVro.js → __federation_fn_import-CpGU4emr.js} +2 -2
- package/dist/web/assets/{__federation_fn_import-5oUmvVro.js.map → __federation_fn_import-CpGU4emr.js.map} +1 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-DURp5OH4.js → web-33D53Q49.js} +5 -5
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-DURp5OH4.js.map → web-33D53Q49.js.map} +1 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/{project-builder-lib-SOC0hDo0.js → project-builder-lib-B8gI4CR0.js} +54 -79
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-B8gI4CR0.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/{ui-components-BIPS02bW.js → ui-components-ClpdcB7_.js} +2970 -16
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-ClpdcB7_.js.map +1 -0
- package/dist/web/assets/{index-BAu6L5Vh.js → index-47TZ-Oc4.js} +2 -2
- package/dist/web/assets/{index-BAu6L5Vh.js.map → index-47TZ-Oc4.js.map} +1 -1
- package/dist/web/assets/{index.esm-C_MMkPsN.js → index.esm-Erws1yaL.js} +90 -47
- package/dist/web/assets/index.esm-Erws1yaL.js.map +1 -0
- package/dist/web/assets/{model-merger-qTOhcMVY.js → model-merger-BteeU9dp.js} +72 -14
- package/dist/web/assets/model-merger-BteeU9dp.js.map +1 -0
- package/dist/web/assets/{plugin-definition-7hIqggth.js → plugin-definition-BOUJurAr.js} +3 -3
- package/dist/web/assets/plugin-definition-BOUJurAr.js.map +1 -0
- package/dist/web/assets/plugin-definition-BeI52Xpr.js +24 -0
- package/dist/web/assets/plugin-definition-BeI52Xpr.js.map +1 -0
- package/dist/web/assets/{plugin-definition-BHJF50Kq.js → plugin-definition-CnMRuS0h.js} +3 -3
- package/dist/web/assets/plugin-definition-CnMRuS0h.js.map +1 -0
- package/dist/web/assets/{react-8Ha9uuy8.js → react-CIaEd3xM.js} +2 -2
- package/dist/web/assets/{react-8Ha9uuy8.js.map → react-CIaEd3xM.js.map} +1 -1
- package/dist/web/assets/remoteEntry.js +14 -8
- package/dist/web/assets/remoteEntry.js.map +1 -1
- package/dist/web/assets/role-editor-form-Bk9sOqqk.js +319 -0
- package/dist/web/assets/role-editor-form-Bk9sOqqk.js.map +1 -0
- package/dist/web/assets/{style-BdgwWjAf.css → style-ZUYizAnf.css} +9 -11
- package/dist/web/assets/styles-mSx3A02F.js +201 -0
- package/dist/web/assets/styles-mSx3A02F.js.map +1 -0
- package/dist/web/index.html +1 -1
- package/manifest.json +1 -1
- package/package.json +12 -11
- package/dist/auth/core/components/role-editor-form.d.ts +0 -10
- package/dist/auth/core/components/role-editor-form.d.ts.map +0 -1
- package/dist/auth/core/components/role-editor-form.js +0 -27
- package/dist/auth/core/components/role-editor-form.js.map +0 -1
- package/dist/auth/generators/fastify/auth-module/auth-module.generator.d.ts.map +0 -1
- package/dist/auth/generators/fastify/auth-module/auth-module.generator.js +0 -74
- package/dist/auth/generators/fastify/auth-module/auth-module.generator.js.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/index.d.ts +0 -88
- package/dist/auth/generators/fastify/auth-module/generated/index.d.ts.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/index.js +0 -9
- package/dist/auth/generators/fastify/auth-module/generated/index.js.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/template-paths.d.ts +0 -16
- package/dist/auth/generators/fastify/auth-module/generated/template-paths.d.ts.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/template-paths.js.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/ts-import-providers.js.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth/generators/fastify/auth-module/generated/typed-templates.js.map +0 -1
- package/dist/auth/generators/fastify/auth-module/index.d.ts.map +0 -1
- package/dist/auth/generators/fastify/auth-module/index.js.map +0 -1
- package/dist/auth/generators/fastify/index.d.ts +0 -2
- package/dist/auth/generators/fastify/index.d.ts.map +0 -1
- package/dist/auth/generators/fastify/index.js +0 -2
- package/dist/auth/generators/fastify/index.js.map +0 -1
- package/dist/auth/generators/index.d.ts +0 -2
- package/dist/auth/generators/index.d.ts.map +0 -1
- package/dist/auth/generators/index.js +0 -2
- package/dist/auth/generators/index.js.map +0 -1
- package/dist/auth0/core/components/role-dialog.d.ts.map +0 -1
- package/dist/auth0/core/components/role-dialog.js.map +0 -1
- package/dist/auth0/core/components/role-editor-form.d.ts +0 -10
- package/dist/auth0/core/components/role-editor-form.d.ts.map +0 -1
- package/dist/auth0/core/components/role-editor-form.js.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.js +0 -48
- package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.js.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/generated/index.d.ts +0 -440
- package/dist/auth0/generators/react/auth0-callback/generated/index.js +0 -9
- package/dist/auth0/generators/react/auth0-callback/generated/index.js.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/generated/template-paths.d.ts +0 -13
- package/dist/auth0/generators/react/auth0-callback/generated/template-paths.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/generated/template-paths.js +0 -23
- package/dist/auth0/generators/react/auth0-callback/generated/template-paths.js.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/generated/template-renderers.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/generated/template-renderers.js +0 -54
- package/dist/auth0/generators/react/auth0-callback/generated/template-renderers.js.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/generated/typed-templates.d.ts +0 -280
- package/dist/auth0/generators/react/auth0-callback/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/generated/typed-templates.js +0 -30
- package/dist/auth0/generators/react/auth0-callback/generated/typed-templates.js.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/index.d.ts +0 -2
- package/dist/auth0/generators/react/auth0-callback/index.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/index.js +0 -2
- package/dist/auth0/generators/react/auth0-callback/index.js.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/templates/routes/auth0-callback.tsx +0 -63
- package/dist/auth0/generators/react/auth0-callback/templates/routes/signup.tsx +0 -48
- package/dist/auth0/generators/react/auth0-components/auth0-components.generator.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-components/auth0-components.generator.js +0 -40
- package/dist/auth0/generators/react/auth0-components/auth0-components.generator.js.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/index.js +0 -11
- package/dist/auth0/generators/react/auth0-components/generated/index.js.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/template-paths.d.ts +0 -12
- package/dist/auth0/generators/react/auth0-components/generated/template-paths.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/template-paths.js +0 -22
- package/dist/auth0/generators/react/auth0-components/generated/template-paths.js.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/template-renderers.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/template-renderers.js +0 -39
- package/dist/auth0/generators/react/auth0-components/generated/template-renderers.js.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-providers.d.ts +0 -10
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-providers.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-providers.js +0 -25
- package/dist/auth0/generators/react/auth0-components/generated/ts-import-providers.js.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/typed-templates.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-components/generated/typed-templates.js.map +0 -1
- package/dist/auth0/generators/react/auth0-components/index.d.ts +0 -2
- package/dist/auth0/generators/react/auth0-components/index.d.ts.map +0 -1
- package/dist/auth0/generators/react/auth0-components/index.js +0 -2
- package/dist/auth0/generators/react/auth0-components/index.js.map +0 -1
- package/dist/auth0/generators/react/auth0-components/templates/src/components/require-auth/require-auth.tsx +0 -22
- package/dist/roles/constants.d.ts.map +0 -1
- package/dist/roles/constants.js.map +0 -1
- package/dist/roles/index.d.ts +0 -3
- package/dist/roles/index.d.ts.map +0 -1
- package/dist/roles/index.js +0 -3
- package/dist/roles/index.js.map +0 -1
- package/dist/roles/schema.d.ts.map +0 -1
- package/dist/roles/schema.js.map +0 -1
- package/dist/utils/cn.d.ts +0 -2
- package/dist/utils/cn.d.ts.map +0 -1
- package/dist/utils/cn.js +0 -2
- package/dist/utils/cn.js.map +0 -1
- package/dist/web/assets/__federation_expose_auth0CoreWeb-T5lCcgD1.js +0 -387
- package/dist/web/assets/__federation_expose_auth0CoreWeb-T5lCcgD1.js.map +0 -1
- package/dist/web/assets/__federation_expose_authCoreWeb-BXQrtVzN.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-SOC0hDo0.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-BIPS02bW.js.map +0 -1
- package/dist/web/assets/index.esm-C_MMkPsN.js.map +0 -1
- package/dist/web/assets/model-merger-qTOhcMVY.js.map +0 -1
- package/dist/web/assets/plugin-definition-7hIqggth.js.map +0 -1
- package/dist/web/assets/plugin-definition-BHJF50Kq.js.map +0 -1
- package/dist/web/assets/schema-BdX0t_km.js +0 -72
- package/dist/web/assets/schema-BdX0t_km.js.map +0 -1
- package/dist/web/assets/styles-3Wg6h_d_.js +0 -8
- package/dist/web/assets/styles-3Wg6h_d_.js.map +0 -1
- /package/dist/auth/{generators/fastify → core/generators}/auth-module/templates/module/constants/user-session.constants.ts +0 -0
- /package/dist/auth/{generators/fastify → core/generators}/auth-module/templates/module/utils/cookie-signer.ts +0 -0
- /package/dist/auth/{generators/fastify → core/generators}/auth-module/templates/module/utils/verify-request-origin.ts +0 -0
- /package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/{useCurrentUser.gql → use-current-user.gql} +0 -0
- /package/dist/auth0/generators/react/auth0-hooks/templates/src/hooks/{useLogOut.ts → use-log-out.ts} +0 -0
- /package/dist/{roles → common/roles}/constants.d.ts +0 -0
- /package/dist/{roles → common/roles}/constants.js +0 -0
- /package/dist/{roles → common/roles}/schema.d.ts +0 -0
- /package/dist/{roles → common/roles}/schema.js +0 -0
- /package/dist/{auth/generators/fastify/auth-module → placeholder-auth/core/generators/placeholder-auth-module}/index.d.ts +0 -0
- /package/dist/{auth/generators/fastify/auth-module → placeholder-auth/core/generators/placeholder-auth-module}/index.js +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { GetCurrentUserSessionDocument } from '%generatedGraphqlImports';
|
|
3
|
+
import { useQuery } from '@apollo/client';
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
import { useUserSessionClient } from '../hooks/use-user-session-client.js';
|
|
6
|
+
/**
|
|
7
|
+
* Checks if the user session matches the loaded ID on first page load.
|
|
8
|
+
*
|
|
9
|
+
* This ensures that we have the correct user ID loaded on first page load.
|
|
10
|
+
*/
|
|
11
|
+
export function UserSessionCheck() {
|
|
12
|
+
const { data } = useQuery(GetCurrentUserSessionDocument, {
|
|
13
|
+
fetchPolicy: 'no-cache',
|
|
14
|
+
});
|
|
15
|
+
const { client } = useUserSessionClient();
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (!data?.currentUserSession?.userId)
|
|
18
|
+
return;
|
|
19
|
+
if (data.currentUserSession.userId !== client.getSession()?.userId) {
|
|
20
|
+
client.signOut();
|
|
21
|
+
}
|
|
22
|
+
}, [data, client]);
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=user-session-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-session-check.js","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/react-session/templates/src/app/user-session-check.tsx"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC,6BAA6B,EAAE;QACvD,WAAW,EAAE,UAAU;KACxB,CAAC,CAAC;IACH,MAAM,EAAE,MAAM,EAAE,GAAG,oBAAoB,EAAE,CAAC;IAE1C,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,IAAI,EAAE,kBAAkB,EAAE,MAAM;YAAE,OAAO;QAE9C,IAAI,IAAI,CAAC,kBAAkB,CAAC,MAAM,KAAK,MAAM,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,CAAC;YACnE,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAEnB,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
import { GetCurrentUserSessionDocument } from '%generatedGraphqlImports';
|
|
4
|
+
import { useQuery } from '@apollo/client';
|
|
5
|
+
import { useEffect } from 'react';
|
|
6
|
+
|
|
7
|
+
import { useUserSessionClient } from '../hooks/use-user-session-client.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Checks if the user session matches the loaded ID on first page load.
|
|
11
|
+
*
|
|
12
|
+
* This ensures that we have the correct user ID loaded on first page load.
|
|
13
|
+
*/
|
|
14
|
+
export function UserSessionCheck(): React.ReactElement | null {
|
|
15
|
+
const { data } = useQuery(GetCurrentUserSessionDocument, {
|
|
16
|
+
fetchPolicy: 'no-cache',
|
|
17
|
+
});
|
|
18
|
+
const { client } = useUserSessionClient();
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!data?.currentUserSession?.userId) return;
|
|
22
|
+
|
|
23
|
+
if (data.currentUserSession.userId !== client.getSession()?.userId) {
|
|
24
|
+
client.signOut();
|
|
25
|
+
}
|
|
26
|
+
}, [data, client]);
|
|
27
|
+
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
interface UserSessionProviderProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function UserSessionProvider({ children, }: UserSessionProviderProps): React.JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=user-session-provider.d.ts.map
|
package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-session-provider.d.ts","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/react-session/templates/src/app/user-session-provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,UAAU,wBAAwB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,GACT,EAAE,wBAAwB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA4B9C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { UserSessionClientContext } from '../hooks/use-user-session-client.js';
|
|
4
|
+
import { createUserSessionClient } from '../services/user-session-client.js';
|
|
5
|
+
export function UserSessionProvider({ children, }) {
|
|
6
|
+
const [userSessionClient] = useState(() => createUserSessionClient());
|
|
7
|
+
const [session, setSession] = useState(userSessionClient.getSession());
|
|
8
|
+
// Subscribe to session changes
|
|
9
|
+
useEffect(() => userSessionClient.onSessionChange((newSession) => {
|
|
10
|
+
setSession(newSession);
|
|
11
|
+
}), [userSessionClient]);
|
|
12
|
+
const contextValue = useMemo(() => ({
|
|
13
|
+
client: userSessionClient,
|
|
14
|
+
session,
|
|
15
|
+
}), [userSessionClient, session]);
|
|
16
|
+
return (_jsx(UserSessionClientContext.Provider, { value: contextValue, children: children }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=user-session-provider.js.map
|
package/dist/auth/core/generators/react-session/templates/src/app/user-session-provider.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-session-provider.js","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/react-session/templates/src/app/user-session-provider.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAKrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAM7E,MAAM,UAAU,mBAAmB,CAAC,EAClC,QAAQ,GACiB;IACzB,MAAM,CAAC,iBAAiB,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,uBAAuB,EAAE,CAAC,CAAC;IACtE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CACpC,iBAAiB,CAAC,UAAU,EAAE,CAC/B,CAAC;IAEF,+BAA+B;IAC/B,SAAS,CACP,GAAG,EAAE,CACH,iBAAiB,CAAC,eAAe,CAAC,CAAC,UAAU,EAAE,EAAE;QAC/C,UAAU,CAAC,UAAU,CAAC,CAAC;IACzB,CAAC,CAAC,EACJ,CAAC,iBAAiB,CAAC,CACpB,CAAC;IAEF,MAAM,YAAY,GAAkC,OAAO,CACzD,GAAG,EAAE,CAAC,CAAC;QACL,MAAM,EAAE,iBAAiB;QACzB,OAAO;KACR,CAAC,EACF,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAC7B,CAAC;IAEF,OAAO,CACL,KAAC,wBAAwB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YACnD,QAAQ,GACyB,CACrC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
import type React from 'react';
|
|
4
|
+
|
|
5
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import type { UserSessionClientContextValue } from '../hooks/use-user-session-client.js';
|
|
8
|
+
import type { UserSessionData } from '../services/user-session-client.js';
|
|
9
|
+
|
|
10
|
+
import { UserSessionClientContext } from '../hooks/use-user-session-client.js';
|
|
11
|
+
import { createUserSessionClient } from '../services/user-session-client.js';
|
|
12
|
+
|
|
13
|
+
interface UserSessionProviderProps {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function UserSessionProvider({
|
|
18
|
+
children,
|
|
19
|
+
}: UserSessionProviderProps): React.JSX.Element {
|
|
20
|
+
const [userSessionClient] = useState(() => createUserSessionClient());
|
|
21
|
+
const [session, setSession] = useState<UserSessionData | undefined>(
|
|
22
|
+
userSessionClient.getSession(),
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
// Subscribe to session changes
|
|
26
|
+
useEffect(
|
|
27
|
+
() =>
|
|
28
|
+
userSessionClient.onSessionChange((newSession) => {
|
|
29
|
+
setSession(newSession);
|
|
30
|
+
}),
|
|
31
|
+
[userSessionClient],
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const contextValue: UserSessionClientContextValue = useMemo(
|
|
35
|
+
() => ({
|
|
36
|
+
client: userSessionClient,
|
|
37
|
+
session,
|
|
38
|
+
}),
|
|
39
|
+
[userSessionClient, session],
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<UserSessionClientContext.Provider value={contextValue}>
|
|
44
|
+
{children}
|
|
45
|
+
</UserSessionClientContext.Provider>
|
|
46
|
+
);
|
|
47
|
+
}
|
package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { UserSessionClient, UserSessionData } from '../services/user-session-client.js';
|
|
2
|
+
export interface UserSessionClientContextValue {
|
|
3
|
+
client: UserSessionClient;
|
|
4
|
+
session: UserSessionData | undefined;
|
|
5
|
+
}
|
|
6
|
+
export declare const UserSessionClientContext: import("react").Context<UserSessionClientContextValue | undefined>;
|
|
7
|
+
/**
|
|
8
|
+
* Hook to get the user session client
|
|
9
|
+
* @returns The user session client
|
|
10
|
+
*/
|
|
11
|
+
export declare function useUserSessionClient(): UserSessionClientContextValue;
|
|
12
|
+
//# sourceMappingURL=use-user-session-client.d.ts.map
|
package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-user-session-client.d.ts","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,oCAAoC,CAAC;AAE5C,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,eAAe,GAAG,SAAS,CAAC;CACtC;AAED,eAAO,MAAM,wBAAwB,oEAEzB,CAAC;AAEb;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,6BAA6B,CAUpE"}
|
package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
export const UserSessionClientContext = createContext(undefined);
|
|
4
|
+
/**
|
|
5
|
+
* Hook to get the user session client
|
|
6
|
+
* @returns The user session client
|
|
7
|
+
*/
|
|
8
|
+
export function useUserSessionClient() {
|
|
9
|
+
const client = useContext(UserSessionClientContext);
|
|
10
|
+
if (!client) {
|
|
11
|
+
throw new Error('useUserSessionClient must be used within a UserSessionClientProvider');
|
|
12
|
+
}
|
|
13
|
+
return client;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=use-user-session-client.js.map
|
package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-user-session-client.js","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAYlD,MAAM,CAAC,MAAM,wBAAwB,GAAG,aAAa,CAEnD,SAAS,CAAC,CAAC;AAEb;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAClC,MAAM,MAAM,GAAG,UAAU,CAAC,wBAAwB,CAAC,CAAC;IAEpD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,sEAAsE,CACvE,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/auth/core/generators/react-session/templates/src/hooks/use-user-session-client.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
import { createContext, useContext } from 'react';
|
|
4
|
+
|
|
5
|
+
import type {
|
|
6
|
+
UserSessionClient,
|
|
7
|
+
UserSessionData,
|
|
8
|
+
} from '../services/user-session-client.js';
|
|
9
|
+
|
|
10
|
+
export interface UserSessionClientContextValue {
|
|
11
|
+
client: UserSessionClient;
|
|
12
|
+
session: UserSessionData | undefined;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const UserSessionClientContext = createContext<
|
|
16
|
+
UserSessionClientContextValue | undefined
|
|
17
|
+
>(undefined);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Hook to get the user session client
|
|
21
|
+
* @returns The user session client
|
|
22
|
+
*/
|
|
23
|
+
export function useUserSessionClient(): UserSessionClientContextValue {
|
|
24
|
+
const client = useContext(UserSessionClientContext);
|
|
25
|
+
|
|
26
|
+
if (!client) {
|
|
27
|
+
throw new Error(
|
|
28
|
+
'useUserSessionClient must be used within a UserSessionClientProvider',
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return client;
|
|
33
|
+
}
|
package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session data returned by the user session client
|
|
3
|
+
*/
|
|
4
|
+
export interface UserSessionData {
|
|
5
|
+
userId: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Callback function for session change events
|
|
9
|
+
*/
|
|
10
|
+
export type SessionChangeCallback = (session: UserSessionData | undefined) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Configuration options for creating the user session client
|
|
13
|
+
*/
|
|
14
|
+
export interface UserSessionClientConfig {
|
|
15
|
+
/**
|
|
16
|
+
* Optional initial session data
|
|
17
|
+
*/
|
|
18
|
+
initialSession?: UserSessionData;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* User session client for managing session persistence using localStorage
|
|
22
|
+
* Handles session state persistence and cross-tab synchronization
|
|
23
|
+
*/
|
|
24
|
+
export declare class UserSessionClient {
|
|
25
|
+
private static readonly USER_ID_STORAGE_KEY;
|
|
26
|
+
private readonly storage;
|
|
27
|
+
private readonly callbacks;
|
|
28
|
+
private cleanupListener?;
|
|
29
|
+
constructor(config?: UserSessionClientConfig);
|
|
30
|
+
/**
|
|
31
|
+
* Get the current session data
|
|
32
|
+
* @returns Current session information
|
|
33
|
+
*/
|
|
34
|
+
getSession(): UserSessionData | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Sign in a user with the given user ID
|
|
37
|
+
* @param userId - The user ID to sign in
|
|
38
|
+
*/
|
|
39
|
+
signIn(userId: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* Sign out the current user
|
|
42
|
+
*/
|
|
43
|
+
signOut(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Subscribe to session changes
|
|
46
|
+
* @param callback - Function to call when session changes
|
|
47
|
+
* @returns Cleanup function to unsubscribe
|
|
48
|
+
*/
|
|
49
|
+
onSessionChange(callback: SessionChangeCallback): () => void;
|
|
50
|
+
/**
|
|
51
|
+
* Clean up resources when the client is no longer needed
|
|
52
|
+
*/
|
|
53
|
+
destroy(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Get the current user ID from storage
|
|
56
|
+
* @returns User ID or null if not authenticated
|
|
57
|
+
*/
|
|
58
|
+
private getUserId;
|
|
59
|
+
/**
|
|
60
|
+
* Set the user ID in storage
|
|
61
|
+
* @param userId - User ID to store, or null to clear
|
|
62
|
+
*/
|
|
63
|
+
private setUserId;
|
|
64
|
+
/**
|
|
65
|
+
* Set up storage listener for cross-tab synchronization
|
|
66
|
+
*/
|
|
67
|
+
private setupStorageListener;
|
|
68
|
+
/**
|
|
69
|
+
* Notify all registered callbacks of session changes
|
|
70
|
+
*/
|
|
71
|
+
private notifyCallbacks;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Factory function to create a user session client
|
|
75
|
+
* @param config - Optional configuration for the client
|
|
76
|
+
* @returns New UserSessionClient instance
|
|
77
|
+
*/
|
|
78
|
+
export declare function createUserSessionClient(config?: UserSessionClientConfig): UserSessionClient;
|
|
79
|
+
//# sourceMappingURL=user-session-client.d.ts.map
|
package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-session-client.d.ts","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/react-session/templates/src/services/user-session-client.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,OAAO,EAAE,eAAe,GAAG,SAAS,KACjC,IAAI,CAAC;AAEV;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,cAAc,CAAC,EAAE,eAAe,CAAC;CAClC;AAED;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAiB;IAC5D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IACjD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoC;IAC9D,OAAO,CAAC,eAAe,CAAC,CAAa;gBAEzB,MAAM,CAAC,EAAE,uBAAuB;IAU5C;;;OAGG;IACH,UAAU,IAAI,eAAe,GAAG,SAAS;IAKzC;;;OAGG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAK5B;;OAEG;IACH,OAAO,IAAI,IAAI;IAKf;;;;OAIG;IACH,eAAe,CAAC,QAAQ,EAAE,qBAAqB,GAAG,MAAM,IAAI;IAO5D;;OAEG;IACH,OAAO,IAAI,IAAI;IAKf;;;OAGG;IACH,OAAO,CAAC,SAAS;IAIjB;;;OAGG;IACH,OAAO,CAAC,SAAS;IAejB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAQ5B;;OAEG;IACH,OAAO,CAAC,eAAe;CAMxB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,CAAC,EAAE,uBAAuB,GAC/B,iBAAiB,CAEnB"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { getSafeLocalStorage } from '%reactUtilsImports';
|
|
3
|
+
/**
|
|
4
|
+
* User session client for managing session persistence using localStorage
|
|
5
|
+
* Handles session state persistence and cross-tab synchronization
|
|
6
|
+
*/
|
|
7
|
+
export class UserSessionClient {
|
|
8
|
+
constructor(config) {
|
|
9
|
+
Object.defineProperty(this, "storage", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
writable: true,
|
|
13
|
+
value: getSafeLocalStorage()
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(this, "callbacks", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true,
|
|
19
|
+
value: new Set()
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(this, "cleanupListener", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
writable: true,
|
|
25
|
+
value: void 0
|
|
26
|
+
});
|
|
27
|
+
// Initialize storage listener for cross-tab synchronization
|
|
28
|
+
this.setupStorageListener();
|
|
29
|
+
// Set initial session if provided
|
|
30
|
+
if (config?.initialSession?.userId) {
|
|
31
|
+
this.setUserId(config.initialSession.userId);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get the current session data
|
|
36
|
+
* @returns Current session information
|
|
37
|
+
*/
|
|
38
|
+
getSession() {
|
|
39
|
+
const userId = this.getUserId();
|
|
40
|
+
return userId ? { userId } : undefined;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Sign in a user with the given user ID
|
|
44
|
+
* @param userId - The user ID to sign in
|
|
45
|
+
*/
|
|
46
|
+
signIn(userId) {
|
|
47
|
+
this.setUserId(userId);
|
|
48
|
+
this.notifyCallbacks();
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Sign out the current user
|
|
52
|
+
*/
|
|
53
|
+
signOut() {
|
|
54
|
+
this.setUserId(null);
|
|
55
|
+
this.notifyCallbacks();
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Subscribe to session changes
|
|
59
|
+
* @param callback - Function to call when session changes
|
|
60
|
+
* @returns Cleanup function to unsubscribe
|
|
61
|
+
*/
|
|
62
|
+
onSessionChange(callback) {
|
|
63
|
+
this.callbacks.add(callback);
|
|
64
|
+
return () => {
|
|
65
|
+
this.callbacks.delete(callback);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Clean up resources when the client is no longer needed
|
|
70
|
+
*/
|
|
71
|
+
destroy() {
|
|
72
|
+
this.cleanupListener?.();
|
|
73
|
+
this.callbacks.clear();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Get the current user ID from storage
|
|
77
|
+
* @returns User ID or null if not authenticated
|
|
78
|
+
*/
|
|
79
|
+
getUserId() {
|
|
80
|
+
return this.storage.getItem(UserSessionClient.USER_ID_STORAGE_KEY);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Set the user ID in storage
|
|
84
|
+
* @param userId - User ID to store, or null to clear
|
|
85
|
+
*/
|
|
86
|
+
setUserId(userId) {
|
|
87
|
+
const currentUserId = this.getUserId();
|
|
88
|
+
const userIdChanged = userId !== currentUserId;
|
|
89
|
+
if (!userIdChanged) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (userId) {
|
|
93
|
+
this.storage.setItem(UserSessionClient.USER_ID_STORAGE_KEY, userId);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
this.storage.removeItem(UserSessionClient.USER_ID_STORAGE_KEY);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Set up storage listener for cross-tab synchronization
|
|
101
|
+
*/
|
|
102
|
+
setupStorageListener() {
|
|
103
|
+
this.cleanupListener = this.storage.addEventListener((key) => {
|
|
104
|
+
if (key === UserSessionClient.USER_ID_STORAGE_KEY) {
|
|
105
|
+
this.notifyCallbacks();
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Notify all registered callbacks of session changes
|
|
111
|
+
*/
|
|
112
|
+
notifyCallbacks() {
|
|
113
|
+
const session = this.getSession();
|
|
114
|
+
for (const callback of this.callbacks) {
|
|
115
|
+
callback(session);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
Object.defineProperty(UserSessionClient, "USER_ID_STORAGE_KEY", {
|
|
120
|
+
enumerable: true,
|
|
121
|
+
configurable: true,
|
|
122
|
+
writable: true,
|
|
123
|
+
value: 'APP_USER_ID'
|
|
124
|
+
});
|
|
125
|
+
/**
|
|
126
|
+
* Factory function to create a user session client
|
|
127
|
+
* @param config - Optional configuration for the client
|
|
128
|
+
* @returns New UserSessionClient instance
|
|
129
|
+
*/
|
|
130
|
+
export function createUserSessionClient(config) {
|
|
131
|
+
return new UserSessionClient(config);
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=user-session-client.js.map
|
package/dist/auth/core/generators/react-session/templates/src/services/user-session-client.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-session-client.js","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/react-session/templates/src/services/user-session-client.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AA0BzD;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IAM5B,YAAY,MAAgC;QAJ3B;;;;mBAAU,mBAAmB,EAAE;WAAC;QAChC;;;;mBAAY,IAAI,GAAG,EAAyB;WAAC;QACtD;;;;;WAA6B;QAGnC,4DAA4D;QAC5D,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAE5B,kCAAkC;QAClC,IAAI,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC;YACnC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,UAAU;QACR,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACzC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,MAAc;QACnB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACvB,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACH,eAAe,CAAC,QAA+B;QAC7C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC;QACzB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;IAED;;;OAGG;IACK,SAAS;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;IACrE,CAAC;IAED;;;OAGG;IACK,SAAS,CAAC,MAAqB;QACrC,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QACvC,MAAM,aAAa,GAAG,MAAM,KAAK,aAAa,CAAC;QAE/C,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QAED,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;QACtE,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IAED;;OAEG;IACK,oBAAoB;QAC1B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,GAAG,EAAE,EAAE;YAC3D,IAAI,GAAG,KAAK,iBAAiB,CAAC,mBAAmB,EAAE,CAAC;gBAClD,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,eAAe;QACrB,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACtC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;;AA3GuB;;;;WAAsB,aAAa;EAAhB,CAAiB;AA8G9D;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAAgC;IAEhC,OAAO,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
import { getSafeLocalStorage } from '%reactUtilsImports';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Session data returned by the user session client
|
|
7
|
+
*/
|
|
8
|
+
export interface UserSessionData {
|
|
9
|
+
userId: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Callback function for session change events
|
|
14
|
+
*/
|
|
15
|
+
export type SessionChangeCallback = (
|
|
16
|
+
session: UserSessionData | undefined,
|
|
17
|
+
) => void;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Configuration options for creating the user session client
|
|
21
|
+
*/
|
|
22
|
+
export interface UserSessionClientConfig {
|
|
23
|
+
/**
|
|
24
|
+
* Optional initial session data
|
|
25
|
+
*/
|
|
26
|
+
initialSession?: UserSessionData;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* User session client for managing session persistence using localStorage
|
|
31
|
+
* Handles session state persistence and cross-tab synchronization
|
|
32
|
+
*/
|
|
33
|
+
export class UserSessionClient {
|
|
34
|
+
private static readonly USER_ID_STORAGE_KEY = 'APP_USER_ID';
|
|
35
|
+
private readonly storage = getSafeLocalStorage();
|
|
36
|
+
private readonly callbacks = new Set<SessionChangeCallback>();
|
|
37
|
+
private cleanupListener?: () => void;
|
|
38
|
+
|
|
39
|
+
constructor(config?: UserSessionClientConfig) {
|
|
40
|
+
// Initialize storage listener for cross-tab synchronization
|
|
41
|
+
this.setupStorageListener();
|
|
42
|
+
|
|
43
|
+
// Set initial session if provided
|
|
44
|
+
if (config?.initialSession?.userId) {
|
|
45
|
+
this.setUserId(config.initialSession.userId);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Get the current session data
|
|
51
|
+
* @returns Current session information
|
|
52
|
+
*/
|
|
53
|
+
getSession(): UserSessionData | undefined {
|
|
54
|
+
const userId = this.getUserId();
|
|
55
|
+
return userId ? { userId } : undefined;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Sign in a user with the given user ID
|
|
60
|
+
* @param userId - The user ID to sign in
|
|
61
|
+
*/
|
|
62
|
+
signIn(userId: string): void {
|
|
63
|
+
this.setUserId(userId);
|
|
64
|
+
this.notifyCallbacks();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Sign out the current user
|
|
69
|
+
*/
|
|
70
|
+
signOut(): void {
|
|
71
|
+
this.setUserId(null);
|
|
72
|
+
this.notifyCallbacks();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Subscribe to session changes
|
|
77
|
+
* @param callback - Function to call when session changes
|
|
78
|
+
* @returns Cleanup function to unsubscribe
|
|
79
|
+
*/
|
|
80
|
+
onSessionChange(callback: SessionChangeCallback): () => void {
|
|
81
|
+
this.callbacks.add(callback);
|
|
82
|
+
return () => {
|
|
83
|
+
this.callbacks.delete(callback);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Clean up resources when the client is no longer needed
|
|
89
|
+
*/
|
|
90
|
+
destroy(): void {
|
|
91
|
+
this.cleanupListener?.();
|
|
92
|
+
this.callbacks.clear();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Get the current user ID from storage
|
|
97
|
+
* @returns User ID or null if not authenticated
|
|
98
|
+
*/
|
|
99
|
+
private getUserId(): string | null {
|
|
100
|
+
return this.storage.getItem(UserSessionClient.USER_ID_STORAGE_KEY);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Set the user ID in storage
|
|
105
|
+
* @param userId - User ID to store, or null to clear
|
|
106
|
+
*/
|
|
107
|
+
private setUserId(userId: string | null): void {
|
|
108
|
+
const currentUserId = this.getUserId();
|
|
109
|
+
const userIdChanged = userId !== currentUserId;
|
|
110
|
+
|
|
111
|
+
if (!userIdChanged) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (userId) {
|
|
116
|
+
this.storage.setItem(UserSessionClient.USER_ID_STORAGE_KEY, userId);
|
|
117
|
+
} else {
|
|
118
|
+
this.storage.removeItem(UserSessionClient.USER_ID_STORAGE_KEY);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Set up storage listener for cross-tab synchronization
|
|
124
|
+
*/
|
|
125
|
+
private setupStorageListener(): void {
|
|
126
|
+
this.cleanupListener = this.storage.addEventListener((key) => {
|
|
127
|
+
if (key === UserSessionClient.USER_ID_STORAGE_KEY) {
|
|
128
|
+
this.notifyCallbacks();
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Notify all registered callbacks of session changes
|
|
135
|
+
*/
|
|
136
|
+
private notifyCallbacks(): void {
|
|
137
|
+
const session = this.getSession();
|
|
138
|
+
for (const callback of this.callbacks) {
|
|
139
|
+
callback(session);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Factory function to create a user session client
|
|
146
|
+
* @param config - Optional configuration for the client
|
|
147
|
+
* @returns New UserSessionClient instance
|
|
148
|
+
*/
|
|
149
|
+
export function createUserSessionClient(
|
|
150
|
+
config?: UserSessionClientConfig,
|
|
151
|
+
): UserSessionClient {
|
|
152
|
+
return new UserSessionClient(config);
|
|
153
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/auth/core/node.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/auth/core/node.ts"],"names":[],"mappings":";;;AA4BA,wBAiEG"}
|