@baseplate-dev/plugin-auth 1.0.1 → 1.0.3
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/common.js +2 -2
- package/dist/auth/core/common.js.map +1 -1
- package/dist/auth/core/components/auth-definition-editor.d.ts.map +1 -1
- package/dist/auth/core/components/auth-definition-editor.js +11 -7
- 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/{auth0/generators/react/auth0-components → auth/core/generators/auth-module}/generated/index.d.ts.map +1 -1
- 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/auth/core/generators/auth-routes/auth-routes.generator.d.ts +177 -0
- 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/auth/core/generators/auth-routes/generated/index.d.ts.map +1 -0
- 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.d.ts +22 -12
- package/dist/auth/core/schema/plugin-definition.d.ts.map +1 -1
- package/dist/auth/core/schema/plugin-definition.js +10 -10
- 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/common.js +2 -2
- package/dist/auth0/core/common.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 +10 -6
- 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 -48
- package/dist/auth0/core/node.js.map +1 -1
- package/dist/auth0/core/schema/plugin-definition.d.ts +19 -9
- package/dist/auth0/core/schema/plugin-definition.d.ts.map +1 -1
- package/dist/auth0/core/schema/plugin-definition.js +7 -7
- package/dist/auth0/core/schema/plugin-definition.js.map +1 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/index.d.ts +43 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/index.d.ts.map +1 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/index.js +2 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/index.js.map +1 -1
- package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.d.ts +55 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.js +52 -0
- package/dist/auth0/generators/fastify/auth0-module/generated/template-renderers.js.map +1 -0
- 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 +22 -5
- package/dist/auth0/generators/react/auth0-hooks/generated/index.d.ts.map +1 -1
- package/dist/auth0/generators/react/auth0-hooks/generated/index.js +2 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/index.js.map +1 -1
- 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 +29 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.d.ts.map +1 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.js +46 -0
- package/dist/auth0/generators/react/auth0-hooks/generated/template-renderers.js.map +1 -0
- 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-components/auth0-components.generator.d.ts → auth0-pages/auth0-pages.generator.d.ts} +17 -20
- 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-callback → 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-pages/generated/template-renderers.d.ts +145 -0
- 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-callback → react-auth0}/generated/index.d.ts +29 -31
- 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/auth0-callback.generator.d.ts → react-auth0/generated/template-renderers.d.ts} +24 -28
- 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 +3 -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/{roles → common/roles}/schema.d.ts +29 -10
- package/dist/common/roles/schema.d.ts.map +1 -0
- package/dist/{roles → common/roles}/schema.js +7 -6
- 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-BE50qa2_.js → __federation_expose_auth0CoreCommon-ClLdXltM.js} +4 -4
- package/dist/web/assets/__federation_expose_auth0CoreCommon-ClLdXltM.js.map +1 -0
- package/dist/web/assets/__federation_expose_auth0CoreWeb-n4O5Eaci.js +201 -0
- package/dist/web/assets/__federation_expose_auth0CoreWeb-n4O5Eaci.js.map +1 -0
- package/dist/web/assets/{__federation_expose_authCoreCommon-DKyLSPCa.js → __federation_expose_authCoreCommon-DnPBC3Po.js} +4 -4
- package/dist/web/assets/__federation_expose_authCoreCommon-DnPBC3Po.js.map +1 -0
- package/dist/web/assets/{__federation_expose_authCoreWeb-CfCyOvUk.js → __federation_expose_authCoreWeb-xIZTC0Jm.js} +53 -94
- package/dist/web/assets/__federation_expose_authCoreWeb-xIZTC0Jm.js.map +1 -0
- package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-B3uMizrx.js +39 -0
- package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-B3uMizrx.js.map +1 -0
- package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-B_PIacU8.js +197 -0
- package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-B_PIacU8.js.map +1 -0
- package/dist/web/assets/{__federation_fn_import-CxP86CUK.js → __federation_fn_import-CktB8mRs.js} +2 -2
- package/dist/web/assets/{__federation_fn_import-CxP86CUK.js.map → __federation_fn_import-CktB8mRs.js.map} +1 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-BFCvL5ku.js → web-CX2RIWJk.js} +12 -12
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-CX2RIWJk.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/{project-builder-lib-BAwM_-SS.js → project-builder-lib-CScAnw0t.js} +615 -261
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-CScAnw0t.js.map +1 -0
- package/dist/web/assets/__federation_shared_@baseplate-dev/{ui-components-C3uzqK6u.js → ui-components-sv0OhmFj.js} +2970 -16
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-sv0OhmFj.js.map +1 -0
- package/dist/web/assets/{index-scyXBD_d.js → index-C1wLMBlv.js} +2 -2
- package/dist/web/assets/{index-scyXBD_d.js.map → index-C1wLMBlv.js.map} +1 -1
- package/dist/web/assets/{index.esm-DIgRm3lq.js → index.esm-CGKugQk7.js} +90 -47
- package/dist/web/assets/index.esm-CGKugQk7.js.map +1 -0
- package/dist/web/assets/{model-merger-gxuB007n.js → model-merger-DYdmgijL.js} +181 -546
- package/dist/web/assets/model-merger-DYdmgijL.js.map +1 -0
- package/dist/web/assets/plugin-definition-BRtH1ZCf.js +24 -0
- package/dist/web/assets/plugin-definition-BRtH1ZCf.js.map +1 -0
- package/dist/web/assets/plugin-definition-DSr4dqJI.js +36 -0
- package/dist/web/assets/plugin-definition-DSr4dqJI.js.map +1 -0
- package/dist/web/assets/plugin-definition-DkPo-aBg.js +24 -0
- package/dist/web/assets/plugin-definition-DkPo-aBg.js.map +1 -0
- package/dist/web/assets/{react-CAuz_DuX.js → react-S9chR6jh.js} +2 -2
- package/dist/web/assets/{react-CAuz_DuX.js.map → react-S9chR6jh.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-BbHZ0ofl.js +319 -0
- package/dist/web/assets/role-editor-form-BbHZ0ofl.js.map +1 -0
- package/dist/web/assets/{style-BdgwWjAf.css → style-ZUYizAnf.css} +9 -11
- package/dist/web/assets/styles-Bqxfz3Ig.js +201 -0
- package/dist/web/assets/styles-Bqxfz3Ig.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 -58
- package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.js.map +0 -1
- package/dist/auth0/generators/react/auth0-callback/generated/index.js +0 -7
- 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/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.page.tsx +0 -61
- package/dist/auth0/generators/react/auth0-callback/templates/routes/signup.page.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.d.ts +0 -151
- package/dist/auth0/generators/react/auth0-components/generated/index.js +0 -9
- 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/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_auth0CoreCommon-BE50qa2_.js.map +0 -1
- package/dist/web/assets/__federation_expose_auth0CoreWeb-AdDVCP7O.js +0 -381
- package/dist/web/assets/__federation_expose_auth0CoreWeb-AdDVCP7O.js.map +0 -1
- package/dist/web/assets/__federation_expose_authCoreCommon-DKyLSPCa.js.map +0 -1
- package/dist/web/assets/__federation_expose_authCoreWeb-CfCyOvUk.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-BFCvL5ku.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-BAwM_-SS.js.map +0 -1
- package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-C3uzqK6u.js.map +0 -1
- package/dist/web/assets/index.esm-DIgRm3lq.js.map +0 -1
- package/dist/web/assets/model-merger-gxuB007n.js.map +0 -1
- package/dist/web/assets/plugin-definition-Bgi_XH0-.js +0 -22
- package/dist/web/assets/plugin-definition-Bgi_XH0-.js.map +0 -1
- package/dist/web/assets/plugin-definition-EtIvYJxn.js +0 -34
- package/dist/web/assets/plugin-definition-EtIvYJxn.js.map +0 -1
- package/dist/web/assets/schema-BAfRBwYE.js +0 -67
- package/dist/web/assets/schema-BAfRBwYE.js.map +0 -1
- package/dist/web/assets/styles-BpKIyKWd.js +0 -8
- package/dist/web/assets/styles-BpKIyKWd.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/{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 @@
|
|
|
1
|
+
{"version":3,"file":"typed-templates.d.ts","sourceRoot":"","sources":["../../../../../../src/auth/core/generators/auth-module/generated/typed-templates.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,cAAc;;CAA2B,CAAC;AA6CvD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;CAIvB,CAAC;AAiEF,eAAO,MAAM,UAAU;;;;;;;;CAAuD,CAAC;AAE/E,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAK3C,CAAC"}
|
package/dist/auth/{generators/fastify → core/generators}/auth-module/generated/typed-templates.js
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createTsTemplateFile } from '@baseplate-dev/core-generators';
|
|
2
|
-
import { authContextImportsProvider, authRolesImportsProvider, configServiceImportsProvider, errorHandlerServiceImportsProvider, requestServiceContextImportsProvider, userSessionTypesImportsProvider, } from '@baseplate-dev/fastify-generators';
|
|
2
|
+
import { authContextImportsProvider, authRolesImportsProvider, configServiceImportsProvider, errorHandlerServiceImportsProvider, pothosImportsProvider, requestServiceContextImportsProvider, userSessionTypesImportsProvider, } from '@baseplate-dev/fastify-generators';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
const userSessionConstants = createTsTemplateFile({
|
|
5
5
|
fileOptions: { kind: 'singleton' },
|
|
@@ -12,6 +12,42 @@ const userSessionConstants = createTsTemplateFile({
|
|
|
12
12
|
variables: {},
|
|
13
13
|
});
|
|
14
14
|
export const constantsGroup = { userSessionConstants };
|
|
15
|
+
const schemaUserSessionMutations = createTsTemplateFile({
|
|
16
|
+
fileOptions: { kind: 'singleton' },
|
|
17
|
+
group: 'module',
|
|
18
|
+
importMapProviders: { pothosImports: pothosImportsProvider },
|
|
19
|
+
name: 'schema-user-session-mutations',
|
|
20
|
+
source: {
|
|
21
|
+
path: path.join(import.meta.dirname, '../templates/module/schema/user-session.mutations.ts'),
|
|
22
|
+
},
|
|
23
|
+
variables: {},
|
|
24
|
+
});
|
|
25
|
+
const schemaUserSessionPayloadObjectType = createTsTemplateFile({
|
|
26
|
+
fileOptions: { kind: 'singleton' },
|
|
27
|
+
group: 'module',
|
|
28
|
+
importMapProviders: { pothosImports: pothosImportsProvider },
|
|
29
|
+
name: 'schema-user-session-payload-object-type',
|
|
30
|
+
projectExports: { userSessionPayload: {} },
|
|
31
|
+
source: {
|
|
32
|
+
path: path.join(import.meta.dirname, '../templates/module/schema/user-session-payload.object-type.ts'),
|
|
33
|
+
},
|
|
34
|
+
variables: { TPL_PRISMA_USER: {}, TPL_USER_OBJECT_TYPE: {} },
|
|
35
|
+
});
|
|
36
|
+
const schemaUserSessionQueries = createTsTemplateFile({
|
|
37
|
+
fileOptions: { kind: 'singleton' },
|
|
38
|
+
group: 'module',
|
|
39
|
+
importMapProviders: { pothosImports: pothosImportsProvider },
|
|
40
|
+
name: 'schema-user-session-queries',
|
|
41
|
+
source: {
|
|
42
|
+
path: path.join(import.meta.dirname, '../templates/module/schema/user-session.queries.ts'),
|
|
43
|
+
},
|
|
44
|
+
variables: {},
|
|
45
|
+
});
|
|
46
|
+
export const moduleGroup = {
|
|
47
|
+
schemaUserSessionMutations,
|
|
48
|
+
schemaUserSessionPayloadObjectType,
|
|
49
|
+
schemaUserSessionQueries,
|
|
50
|
+
};
|
|
15
51
|
const userSessionService = createTsTemplateFile({
|
|
16
52
|
fileOptions: { kind: 'singleton' },
|
|
17
53
|
importMapProviders: {
|
|
@@ -60,9 +96,10 @@ const verifyRequestOrigin = createTsTemplateFile({
|
|
|
60
96
|
variables: {},
|
|
61
97
|
});
|
|
62
98
|
export const utilsGroup = { cookieSigner, sessionCookie, verifyRequestOrigin };
|
|
63
|
-
export const
|
|
99
|
+
export const AUTH_CORE_AUTH_MODULE_TEMPLATES = {
|
|
64
100
|
constantsGroup,
|
|
65
|
-
|
|
101
|
+
moduleGroup,
|
|
66
102
|
userSessionService,
|
|
103
|
+
utilsGroup,
|
|
67
104
|
};
|
|
68
105
|
//# sourceMappingURL=typed-templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed-templates.js","sourceRoot":"","sources":["../../../../../../src/auth/core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../src/auth/core/generators/auth-module/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,YAAY,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/auth/core/generators/auth-module/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAE3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC"}
|
package/dist/auth/core/generators/auth-module/templates/module/constants/user-session.constants.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines the duration of a user session before it expires, in seconds.
|
|
3
|
+
*/
|
|
4
|
+
export declare const USER_SESSION_DURATION_SEC: number;
|
|
5
|
+
/**
|
|
6
|
+
* Defines the duration after which a user session should be renewed, in seconds.
|
|
7
|
+
*/
|
|
8
|
+
export declare const USER_SESSION_RENEWAL_THRESHOLD_SEC: number;
|
|
9
|
+
/**
|
|
10
|
+
* Sets the maximum possible lifespan of a user session, in seconds, including renewals.
|
|
11
|
+
*
|
|
12
|
+
* A value of 0 allows the session to persist indefinitely, provided it is renewed
|
|
13
|
+
* before the session expiration.
|
|
14
|
+
*/
|
|
15
|
+
export declare const USER_SESSION_MAX_LIFETIME_SEC: number;
|
|
16
|
+
//# sourceMappingURL=user-session.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-session.constants.d.ts","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/auth-module/templates/module/constants/user-session.constants.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,yBAAyB,QAAoB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,kCAAkC,QAAmB,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,EAAQ,MAAM,CAAC"}
|
package/dist/auth/core/generators/auth-module/templates/module/constants/user-session.constants.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* Defines the duration of a user session before it expires, in seconds.
|
|
4
|
+
*/
|
|
5
|
+
export const USER_SESSION_DURATION_SEC = 14 * 24 * 60 * 60; // 14 days
|
|
6
|
+
/**
|
|
7
|
+
* Defines the duration after which a user session should be renewed, in seconds.
|
|
8
|
+
*/
|
|
9
|
+
export const USER_SESSION_RENEWAL_THRESHOLD_SEC = 1 * 24 * 60 * 60; // 1 day
|
|
10
|
+
/**
|
|
11
|
+
* Sets the maximum possible lifespan of a user session, in seconds, including renewals.
|
|
12
|
+
*
|
|
13
|
+
* A value of 0 allows the session to persist indefinitely, provided it is renewed
|
|
14
|
+
* before the session expiration.
|
|
15
|
+
*/
|
|
16
|
+
export const USER_SESSION_MAX_LIFETIME_SEC = 0;
|
|
17
|
+
//# sourceMappingURL=user-session.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-session.constants.js","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/auth-module/templates/module/constants/user-session.constants.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU;AAEtE;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ;AAE5E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-session-payload.object-type.d.ts","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB,KAkB9B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { builder } from '%pothosImports';
|
|
3
|
+
export const userSessionPayload = builder.simpleObject('UserSessionPayload', {
|
|
4
|
+
fields: (t) => ({
|
|
5
|
+
expiresAt: t.field({ type: 'DateTime', nullable: true }),
|
|
6
|
+
userId: t.field({ type: 'Uuid' }),
|
|
7
|
+
}),
|
|
8
|
+
}, (t) => ({
|
|
9
|
+
user: t.prismaField({
|
|
10
|
+
type: TPL_USER_OBJECT_TYPE,
|
|
11
|
+
resolve: async (query, root) => TPL_PRISMA_USER.findUniqueOrThrow({
|
|
12
|
+
where: { id: root.userId },
|
|
13
|
+
...query,
|
|
14
|
+
}),
|
|
15
|
+
}),
|
|
16
|
+
}));
|
|
17
|
+
//# sourceMappingURL=user-session-payload.object-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-session-payload.object-type.js","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC,YAAY,CACpD,oBAAoB,EACpB;IACE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACd,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACxD,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;KAClC,CAAC;CACH,EACD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC;QAClB,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAC7B,eAAe,CAAC,iBAAiB,CAAC;YAChC,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE;YAC1B,GAAG,KAAK;SACT,CAAC;KACL,CAAC;CACH,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
import { builder } from '%pothosImports';
|
|
4
|
+
|
|
5
|
+
export const userSessionPayload = builder.simpleObject(
|
|
6
|
+
'UserSessionPayload',
|
|
7
|
+
{
|
|
8
|
+
fields: (t) => ({
|
|
9
|
+
expiresAt: t.field({ type: 'DateTime', nullable: true }),
|
|
10
|
+
userId: t.field({ type: 'Uuid' }),
|
|
11
|
+
}),
|
|
12
|
+
},
|
|
13
|
+
(t) => ({
|
|
14
|
+
user: t.prismaField({
|
|
15
|
+
type: TPL_USER_OBJECT_TYPE,
|
|
16
|
+
resolve: async (query, root) =>
|
|
17
|
+
TPL_PRISMA_USER.findUniqueOrThrow({
|
|
18
|
+
where: { id: root.userId },
|
|
19
|
+
...query,
|
|
20
|
+
}),
|
|
21
|
+
}),
|
|
22
|
+
}),
|
|
23
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-session.mutations.d.ts","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.ts"],"names":[],"mappings":""}
|
package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { builder } from '%pothosImports';
|
|
3
|
+
import { userSessionService } from '../services/user-session.service.js';
|
|
4
|
+
builder.mutationField('logOut', (t) => t.fieldWithInputPayload({
|
|
5
|
+
authorize: ['public'],
|
|
6
|
+
payload: {
|
|
7
|
+
success: t.payload.boolean({
|
|
8
|
+
description: 'Whether the logout was successful.',
|
|
9
|
+
}),
|
|
10
|
+
},
|
|
11
|
+
resolve: async (parent, args, context) => {
|
|
12
|
+
if (context.auth.session && context.auth.session.type === 'user') {
|
|
13
|
+
await userSessionService.clearSession(context.auth.session, context);
|
|
14
|
+
}
|
|
15
|
+
return { success: true };
|
|
16
|
+
},
|
|
17
|
+
}));
|
|
18
|
+
//# sourceMappingURL=user-session.mutations.js.map
|
package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-session.mutations.js","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,OAAO,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CACpC,CAAC,CAAC,qBAAqB,CAAC;IACtB,SAAS,EAAE,CAAC,QAAQ,CAAC;IACrB,OAAO,EAAE;QACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;YACzB,WAAW,EAAE,oCAAoC;SAClD,CAAC;KACH;IACD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;QACvC,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACjE,MAAM,kBAAkB,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACvE,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF,CAAC,CACH,CAAC"}
|
package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.mutations.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
import { builder } from '%pothosImports';
|
|
4
|
+
|
|
5
|
+
import { userSessionService } from '../services/user-session.service.js';
|
|
6
|
+
|
|
7
|
+
builder.mutationField('logOut', (t) =>
|
|
8
|
+
t.fieldWithInputPayload({
|
|
9
|
+
authorize: ['public'],
|
|
10
|
+
payload: {
|
|
11
|
+
success: t.payload.boolean({
|
|
12
|
+
description: 'Whether the logout was successful.',
|
|
13
|
+
}),
|
|
14
|
+
},
|
|
15
|
+
resolve: async (parent, args, context) => {
|
|
16
|
+
if (context.auth.session && context.auth.session.type === 'user') {
|
|
17
|
+
await userSessionService.clearSession(context.auth.session, context);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return { success: true };
|
|
21
|
+
},
|
|
22
|
+
}),
|
|
23
|
+
);
|
package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-session.queries.d.ts","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/auth-module/templates/module/schema/user-session.queries.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { builder } from '%pothosImports';
|
|
3
|
+
import { userSessionPayload } from './user-session-payload.object-type.js';
|
|
4
|
+
builder.queryField('currentUserSession', (t) => t.field({
|
|
5
|
+
type: userSessionPayload,
|
|
6
|
+
description: 'Get the current user session',
|
|
7
|
+
nullable: true,
|
|
8
|
+
authorize: ['public'],
|
|
9
|
+
resolve: (root, args, { auth }) => {
|
|
10
|
+
if (!auth.session || auth.session.type !== 'user') {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
expiresAt: auth.session.expiresAt?.toISOString(),
|
|
15
|
+
userId: auth.session.userId,
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
}));
|
|
19
|
+
//# sourceMappingURL=user-session.queries.js.map
|
package/dist/auth/core/generators/auth-module/templates/module/schema/user-session.queries.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-session.queries.js","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/auth-module/templates/module/schema/user-session.queries.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,OAAO,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAC,EAAE,EAAE,CAC7C,CAAC,CAAC,KAAK,CAAC;IACN,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,8BAA8B;IAC3C,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,CAAC,QAAQ,CAAC;IACrB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QAChC,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAClD,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,WAAW,EAAE;YAChD,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;SAC5B,CAAC;IACJ,CAAC;CACF,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
import { builder } from '%pothosImports';
|
|
4
|
+
|
|
5
|
+
import { userSessionPayload } from './user-session-payload.object-type.js';
|
|
6
|
+
|
|
7
|
+
builder.queryField('currentUserSession', (t) =>
|
|
8
|
+
t.field({
|
|
9
|
+
type: userSessionPayload,
|
|
10
|
+
description: 'Get the current user session',
|
|
11
|
+
nullable: true,
|
|
12
|
+
authorize: ['public'],
|
|
13
|
+
resolve: (root, args, { auth }) => {
|
|
14
|
+
if (!auth.session || auth.session.type !== 'user') {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
expiresAt: auth.session.expiresAt?.toISOString(),
|
|
20
|
+
userId: auth.session.userId,
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
);
|
package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { AuthUserSessionInfo } from '%authContextImports';
|
|
2
|
+
import type { RequestServiceContext } from '%requestServiceContextImports';
|
|
3
|
+
import type { UserSessionPayload, UserSessionService } from '%userSessionTypesImports';
|
|
4
|
+
import type { FastifyReply, FastifyRequest } from 'fastify';
|
|
5
|
+
export declare class CookieUserSessionService implements UserSessionService {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a user session cookie and sets it in the response.
|
|
8
|
+
*
|
|
9
|
+
* @param userId The ID of the user for whom the session is being created.
|
|
10
|
+
* @param context The request service context
|
|
11
|
+
* @param currentDate The current date and time. Defaults to the current date and time.
|
|
12
|
+
* @returns The session payload
|
|
13
|
+
*/
|
|
14
|
+
createSession(userId: string, context: RequestServiceContext, currentDate?: Date): Promise<UserSessionPayload>;
|
|
15
|
+
/**
|
|
16
|
+
* Ends the user session by clearing the session cookie and deleting the session from the database.
|
|
17
|
+
*
|
|
18
|
+
* @param sessionInfo The session info
|
|
19
|
+
* @param context The request service context
|
|
20
|
+
*/
|
|
21
|
+
clearSession(sessionInfo: AuthUserSessionInfo, context: RequestServiceContext): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves the user session information from the request.
|
|
24
|
+
*
|
|
25
|
+
* @param req - The Fastify request object containing the cookies.
|
|
26
|
+
* @param reply - The Fastify reply object used to set or clear cookies.
|
|
27
|
+
* @param currentDate - The current date used for session validation. Defaults to the current date and time.
|
|
28
|
+
* @returns A promise that resolves to the authenticated user session information or null if the session is invalid.
|
|
29
|
+
* @throws {InvalidSessionError} If the session is invalid or expired.
|
|
30
|
+
*/
|
|
31
|
+
getSessionInfoFromRequest(req: FastifyRequest, reply?: FastifyReply): Promise<AuthUserSessionInfo | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves the user session information from the authentication token
|
|
34
|
+
*
|
|
35
|
+
* Note: Since we use cookies, we ignore the authToken parameter
|
|
36
|
+
*
|
|
37
|
+
* @param req The request object
|
|
38
|
+
* @returns The session info or undefined if no session is found
|
|
39
|
+
*/
|
|
40
|
+
getSessionInfoFromToken(req: FastifyRequest): Promise<AuthUserSessionInfo | undefined>;
|
|
41
|
+
}
|
|
42
|
+
export declare const userSessionService: CookieUserSessionService;
|
|
43
|
+
//# sourceMappingURL=user-session.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-session.service.d.ts","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/auth-module/templates/module/services/user-session.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAkF5D,qBAAa,wBAAyB,YAAW,kBAAkB;IACjE;;;;;;;OAOG;IACG,aAAa,CACjB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,qBAAqB,EAC9B,WAAW,GAAE,IAAiB,GAC7B,OAAO,CAAC,kBAAkB,CAAC;IAsB9B;;;;;OAKG;IACG,YAAY,CAChB,WAAW,EAAE,mBAAmB,EAChC,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,IAAI,CAAC;IAShB;;;;;;;;OAQG;IACG,yBAAyB,CAC7B,GAAG,EAAE,cAAc,EACnB,KAAK,CAAC,EAAE,YAAY,GACnB,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;IA8E3C;;;;;;;OAOG;IACG,uBAAuB,CAC3B,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;CAG5C;AAED,eAAO,MAAM,kBAAkB,0BAAiC,CAAC"}
|
package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.js
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { InvalidSessionError } from '%authContextImports';
|
|
3
|
+
import { DEFAULT_USER_ROLES } from '%authRolesImports';
|
|
4
|
+
import { config } from '%configServiceImports';
|
|
5
|
+
import { ForbiddenError } from '%errorHandlerServiceImports';
|
|
6
|
+
import { randomBytes } from 'node:crypto';
|
|
7
|
+
import { USER_SESSION_DURATION_SEC, USER_SESSION_MAX_LIFETIME_SEC, USER_SESSION_RENEWAL_THRESHOLD_SEC, } from '../constants/user-session.constants.js';
|
|
8
|
+
import { signObject, unsignObject } from '../utils/cookie-signer.js';
|
|
9
|
+
import { getUserSessionCookieName } from '../utils/session-cookie.js';
|
|
10
|
+
import { verifyRequestOrigin } from '../utils/verify-request-origin.js';
|
|
11
|
+
const COOKIE_OPTIONS = {
|
|
12
|
+
httpOnly: true,
|
|
13
|
+
sameSite: 'lax',
|
|
14
|
+
secure: config.APP_ENVIRONMENT !== 'dev',
|
|
15
|
+
maxAge: USER_SESSION_DURATION_SEC,
|
|
16
|
+
path: '/',
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Validates the expiry of a user session and determines if it needs to be renewed.
|
|
20
|
+
*
|
|
21
|
+
* @param currentDate The current date and time.
|
|
22
|
+
* @param userSession The session details.
|
|
23
|
+
* @param userSession.expiresAt The date and time when the session expires.
|
|
24
|
+
* @param userSession.createdAt The date and time when the session was created.
|
|
25
|
+
* @param userSession.renewedAt The date and time when the session was last renewed.
|
|
26
|
+
* @returns The validity of the session and the new expiry date if applicable.
|
|
27
|
+
*/
|
|
28
|
+
function validateSessionExpiry(currentDate, userSession) {
|
|
29
|
+
// check if session is expired
|
|
30
|
+
if (userSession.expiresAt < currentDate) {
|
|
31
|
+
return { valid: false, newExpiry: null };
|
|
32
|
+
}
|
|
33
|
+
// check if session needs renewal
|
|
34
|
+
const shouldRenewBy = userSession.renewedAt.getTime() + USER_SESSION_RENEWAL_THRESHOLD_SEC * 1000;
|
|
35
|
+
if (shouldRenewBy < currentDate.getTime()) {
|
|
36
|
+
const newExpiry = currentDate.getTime() + USER_SESSION_DURATION_SEC * 1000;
|
|
37
|
+
const maxExpiry = USER_SESSION_MAX_LIFETIME_SEC === 0
|
|
38
|
+
? undefined
|
|
39
|
+
: userSession.createdAt.getTime() +
|
|
40
|
+
USER_SESSION_MAX_LIFETIME_SEC * 1000;
|
|
41
|
+
return {
|
|
42
|
+
valid: true,
|
|
43
|
+
newExpiry: new Date(Math.min(newExpiry, maxExpiry ?? newExpiry)),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return { valid: true, newExpiry: null };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Generates a session token
|
|
50
|
+
*
|
|
51
|
+
* @returns The session token
|
|
52
|
+
*/
|
|
53
|
+
function generateSessionToken() {
|
|
54
|
+
return randomBytes(16).toString('base64url');
|
|
55
|
+
}
|
|
56
|
+
export class CookieUserSessionService {
|
|
57
|
+
/**
|
|
58
|
+
* Creates a user session cookie and sets it in the response.
|
|
59
|
+
*
|
|
60
|
+
* @param userId The ID of the user for whom the session is being created.
|
|
61
|
+
* @param context The request service context
|
|
62
|
+
* @param currentDate The current date and time. Defaults to the current date and time.
|
|
63
|
+
* @returns The session payload
|
|
64
|
+
*/
|
|
65
|
+
async createSession(userId, context, currentDate = new Date()) {
|
|
66
|
+
const token = generateSessionToken();
|
|
67
|
+
const expiresAt = new Date(currentDate.getTime() + USER_SESSION_DURATION_SEC * 1000);
|
|
68
|
+
await TPL_PRISMA_USER_SESSION.create({
|
|
69
|
+
data: {
|
|
70
|
+
user: { connect: { id: userId } },
|
|
71
|
+
token,
|
|
72
|
+
expiresAt,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
const cookieName = getUserSessionCookieName(context.reqInfo.headers);
|
|
76
|
+
const cookieValue = signObject({ token }, config.AUTH_SECRET);
|
|
77
|
+
context.cookieStore.set(cookieName, cookieValue, COOKIE_OPTIONS);
|
|
78
|
+
return { userId, expiresAt };
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Ends the user session by clearing the session cookie and deleting the session from the database.
|
|
82
|
+
*
|
|
83
|
+
* @param sessionInfo The session info
|
|
84
|
+
* @param context The request service context
|
|
85
|
+
*/
|
|
86
|
+
async clearSession(sessionInfo, context) {
|
|
87
|
+
await TPL_PRISMA_USER_SESSION.delete({
|
|
88
|
+
where: { id: sessionInfo.id },
|
|
89
|
+
});
|
|
90
|
+
const cookieName = getUserSessionCookieName(context.reqInfo.headers);
|
|
91
|
+
context.cookieStore.clear(cookieName);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Retrieves the user session information from the request.
|
|
95
|
+
*
|
|
96
|
+
* @param req - The Fastify request object containing the cookies.
|
|
97
|
+
* @param reply - The Fastify reply object used to set or clear cookies.
|
|
98
|
+
* @param currentDate - The current date used for session validation. Defaults to the current date and time.
|
|
99
|
+
* @returns A promise that resolves to the authenticated user session information or null if the session is invalid.
|
|
100
|
+
* @throws {InvalidSessionError} If the session is invalid or expired.
|
|
101
|
+
*/
|
|
102
|
+
async getSessionInfoFromRequest(req, reply) {
|
|
103
|
+
const currentDate = new Date();
|
|
104
|
+
// Check Origin header for non-GET/HEAD requests to prevent CSRF attacks
|
|
105
|
+
if ((req.method !== 'GET' ||
|
|
106
|
+
req.headers.upgrade?.toLowerCase() === 'websocket') &&
|
|
107
|
+
req.method !== 'HEAD' &&
|
|
108
|
+
!verifyRequestOrigin(req, [req.host])) {
|
|
109
|
+
throw new ForbiddenError('Invalid Origin header');
|
|
110
|
+
}
|
|
111
|
+
const cookieName = getUserSessionCookieName(req.headers);
|
|
112
|
+
try {
|
|
113
|
+
// Check if the session cookie is present
|
|
114
|
+
const sessionCookieValue = req.cookies[cookieName];
|
|
115
|
+
if (!sessionCookieValue)
|
|
116
|
+
return undefined;
|
|
117
|
+
// Unsign the session cookie
|
|
118
|
+
const sessionCookieResult = unsignObject(sessionCookieValue, config.AUTH_SECRET);
|
|
119
|
+
if (!sessionCookieResult)
|
|
120
|
+
throw new InvalidSessionError();
|
|
121
|
+
const { token } = sessionCookieResult;
|
|
122
|
+
if (typeof token !== 'string')
|
|
123
|
+
throw new InvalidSessionError();
|
|
124
|
+
// Fetch and validate user session
|
|
125
|
+
const userSession = await TPL_PRISMA_USER_SESSION.findUnique({
|
|
126
|
+
where: { token },
|
|
127
|
+
include: { user: { select: { id: true, roles: true } } },
|
|
128
|
+
});
|
|
129
|
+
if (!userSession)
|
|
130
|
+
throw new InvalidSessionError();
|
|
131
|
+
const sessionExpiryResult = validateSessionExpiry(currentDate, userSession);
|
|
132
|
+
if (!sessionExpiryResult.valid)
|
|
133
|
+
throw new InvalidSessionError('Session expired');
|
|
134
|
+
// renew the session if needed
|
|
135
|
+
if (sessionExpiryResult.newExpiry && reply) {
|
|
136
|
+
await TPL_PRISMA_USER_SESSION.update({
|
|
137
|
+
where: { id: userSession.id },
|
|
138
|
+
data: {
|
|
139
|
+
renewedAt: currentDate,
|
|
140
|
+
expiresAt: sessionExpiryResult.newExpiry,
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
const newSignedCookie = signObject({ token }, config.AUTH_SECRET);
|
|
144
|
+
reply.setCookie(cookieName, newSignedCookie, COOKIE_OPTIONS);
|
|
145
|
+
}
|
|
146
|
+
const { user } = userSession;
|
|
147
|
+
const expiresAt = sessionExpiryResult.newExpiry ?? userSession.expiresAt;
|
|
148
|
+
return {
|
|
149
|
+
id: userSession.id,
|
|
150
|
+
type: 'user',
|
|
151
|
+
roles: [
|
|
152
|
+
...DEFAULT_USER_ROLES,
|
|
153
|
+
...user.roles.map((role) => role.role),
|
|
154
|
+
],
|
|
155
|
+
userId: user.id,
|
|
156
|
+
expiresAt,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
// clear the cookie if it's invalid
|
|
161
|
+
if (err instanceof InvalidSessionError && reply) {
|
|
162
|
+
reply.clearCookie(cookieName);
|
|
163
|
+
}
|
|
164
|
+
throw err;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Retrieves the user session information from the authentication token
|
|
169
|
+
*
|
|
170
|
+
* Note: Since we use cookies, we ignore the authToken parameter
|
|
171
|
+
*
|
|
172
|
+
* @param req The request object
|
|
173
|
+
* @returns The session info or undefined if no session is found
|
|
174
|
+
*/
|
|
175
|
+
async getSessionInfoFromToken(req) {
|
|
176
|
+
return this.getSessionInfoFromRequest(req, undefined);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
export const userSessionService = new CookieUserSessionService();
|
|
180
|
+
//# sourceMappingURL=user-session.service.js.map
|
package/dist/auth/core/generators/auth-module/templates/module/services/user-session.service.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-session.service.js","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/auth-module/templates/module/services/user-session.service.ts"],"names":[],"mappings":"AAAA,cAAc;AAYd,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,aA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AAmB,IAAI,KAAK,EAAE,CAAC;gBAChD,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;YAChC,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,uBAAuB,CAC3B,GAAmB;QAEnB,OAAO,IAAI,CAAC,yBAAyB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IACxD,CAAC;CACF;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
|
|
@@ -33,7 +33,7 @@ interface SessionCookieValue {
|
|
|
33
33
|
const COOKIE_OPTIONS: CookieSerializeOptions = {
|
|
34
34
|
httpOnly: true,
|
|
35
35
|
sameSite: 'lax',
|
|
36
|
-
secure: config.APP_ENVIRONMENT !== '
|
|
36
|
+
secure: config.APP_ENVIRONMENT !== 'dev',
|
|
37
37
|
maxAge: USER_SESSION_DURATION_SEC,
|
|
38
38
|
path: '/',
|
|
39
39
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cookie signing utilities
|
|
3
|
+
* Based on node-cookie-signature by TJ Holowaychuk
|
|
4
|
+
* Source: https://github.com/tj/node-cookie-signature
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Sign the given `val` with `secret` using HMAC-SHA256.
|
|
8
|
+
*
|
|
9
|
+
* @param val - The value to sign.
|
|
10
|
+
* @param secret - The secret key to use for signing.
|
|
11
|
+
* @returns The signed value.
|
|
12
|
+
*/
|
|
13
|
+
export declare function sign(val: string, secret: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Unsign and decode the given `input` with `secret`,
|
|
16
|
+
*
|
|
17
|
+
* @param input - The signed cookie string to unsign.
|
|
18
|
+
* @param secret - The secret key used for signing.
|
|
19
|
+
* @returns The unsigned value or undefined if the signature is invalid.
|
|
20
|
+
*/
|
|
21
|
+
export declare function unsign(input: string, secret: string): string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Sign an object by JSON stringifying and base64 encoding it, then signing with secret.
|
|
24
|
+
*
|
|
25
|
+
* @param obj - The object to sign.
|
|
26
|
+
* @param secret - The secret key to use for signing.
|
|
27
|
+
* @returns The signed encoded object.
|
|
28
|
+
*/
|
|
29
|
+
export declare function signObject(obj: unknown, secret: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Unsign and decode an object that was signed with signObject.
|
|
32
|
+
*
|
|
33
|
+
* @param input - The signed encoded object string to unsign.
|
|
34
|
+
* @param secret - The secret key used for signing.
|
|
35
|
+
* @returns The decoded object or undefined if the signature is invalid.
|
|
36
|
+
*/
|
|
37
|
+
export declare function unsignObject(input: string, secret: string): unknown;
|
|
38
|
+
//# sourceMappingURL=cookie-signer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cookie-signer.d.ts","sourceRoot":"","sources":["../../../../../../../../src/auth/core/generators/auth-module/templates/module/utils/cookie-signer.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAOxD;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAYxE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAG/D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAUnE"}
|