@colveor/core 1.1.0 → 1.2.1
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/CHANGELOG.md +24 -0
- package/README.md +6 -0
- package/dist/bootstrap/bootstrap-colveor-app.d.ts.map +1 -1
- package/dist/bootstrap/bootstrap-colveor-app.js +22 -3
- package/dist/bootstrap/bootstrap-colveor-app.js.map +1 -1
- package/dist/common/decorators/index.d.ts +6 -0
- package/dist/common/decorators/index.d.ts.map +1 -1
- package/dist/common/decorators/index.js +8 -1
- package/dist/common/decorators/index.js.map +1 -1
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts +9 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.d.ts.map +1 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.js +12 -0
- package/dist/common/decorators/ip-rate-limit-bucket.decorator.js.map +1 -0
- package/dist/common/guards/login-ip-rate-limit.guard.d.ts +12 -6
- package/dist/common/guards/login-ip-rate-limit.guard.d.ts.map +1 -1
- package/dist/common/guards/login-ip-rate-limit.guard.js +65 -21
- package/dist/common/guards/login-ip-rate-limit.guard.js.map +1 -1
- package/dist/common/guards/otp-ip-rate-limit.guard.d.ts +3 -2
- package/dist/common/guards/otp-ip-rate-limit.guard.d.ts.map +1 -1
- package/dist/common/guards/otp-ip-rate-limit.guard.js +17 -15
- package/dist/common/guards/otp-ip-rate-limit.guard.js.map +1 -1
- package/dist/common/guards/permissions.guard.d.ts.map +1 -1
- package/dist/common/guards/permissions.guard.js +12 -2
- package/dist/common/guards/permissions.guard.js.map +1 -1
- package/dist/common/interceptors/timeout.interceptor.d.ts +1 -1
- package/dist/common/interceptors/timeout.interceptor.d.ts.map +1 -1
- package/dist/common/interceptors/timeout.interceptor.js +5 -1
- package/dist/common/interceptors/timeout.interceptor.js.map +1 -1
- package/dist/common/interfaces/request-user.d.ts +4 -3
- package/dist/common/interfaces/request-user.d.ts.map +1 -1
- package/dist/common/utils/cache-version.util.d.ts +12 -0
- package/dist/common/utils/cache-version.util.d.ts.map +1 -0
- package/dist/common/utils/cache-version.util.js +34 -0
- package/dist/common/utils/cache-version.util.js.map +1 -0
- package/dist/common/utils/postgres-error.util.d.ts +5 -0
- package/dist/common/utils/postgres-error.util.d.ts.map +1 -0
- package/dist/common/utils/postgres-error.util.js +13 -0
- package/dist/common/utils/postgres-error.util.js.map +1 -0
- package/dist/common/utils/singleflight.util.d.ts +6 -0
- package/dist/common/utils/singleflight.util.d.ts.map +1 -0
- package/dist/common/utils/singleflight.util.js +21 -0
- package/dist/common/utils/singleflight.util.js.map +1 -0
- package/dist/common/validators/is-exclusive-auth-params.validator.js +1 -1
- package/dist/common/validators/is-exclusive-auth-params.validator.js.map +1 -1
- package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js +1 -1
- package/dist/common/validators/is-exclusive-delete-confirm-params.validator.js.map +1 -1
- package/dist/config/app.config.d.ts +38 -0
- package/dist/config/app.config.d.ts.map +1 -1
- package/dist/config/app.config.js +24 -0
- package/dist/config/app.config.js.map +1 -1
- package/dist/config/database.config.d.ts +6 -0
- package/dist/config/database.config.d.ts.map +1 -1
- package/dist/config/database.config.js +3 -0
- package/dist/config/database.config.js.map +1 -1
- package/dist/config/env-flags.util.d.ts +4 -0
- package/dist/config/env-flags.util.d.ts.map +1 -1
- package/dist/config/env-flags.util.js +7 -0
- package/dist/config/env-flags.util.js.map +1 -1
- package/dist/config/env.validation.d.ts +24 -1
- package/dist/config/env.validation.d.ts.map +1 -1
- package/dist/config/env.validation.js +92 -2
- package/dist/config/env.validation.js.map +1 -1
- package/dist/config/in-memory-redis.client.d.ts +23 -4
- package/dist/config/in-memory-redis.client.d.ts.map +1 -1
- package/dist/config/in-memory-redis.client.js +148 -4
- package/dist/config/in-memory-redis.client.js.map +1 -1
- package/dist/config/redis.module.d.ts.map +1 -1
- package/dist/config/redis.module.js +5 -0
- package/dist/config/redis.module.js.map +1 -1
- package/dist/core.module.d.ts +5 -0
- package/dist/core.module.d.ts.map +1 -1
- package/dist/core.module.js +5 -0
- package/dist/core.module.js.map +1 -1
- package/dist/database/migrations/1784284557959-full-schema.d.ts.map +1 -1
- package/dist/database/migrations/1784284557959-full-schema.js +48 -14
- package/dist/database/migrations/1784284557959-full-schema.js.map +1 -1
- package/dist/database/migrations/1784284557960-audit-partitioning.d.ts +17 -0
- package/dist/database/migrations/1784284557960-audit-partitioning.d.ts.map +1 -0
- package/dist/database/migrations/1784284557960-audit-partitioning.js +384 -0
- package/dist/database/migrations/1784284557960-audit-partitioning.js.map +1 -0
- package/dist/database/seeds/roles.seed.d.ts +6 -0
- package/dist/database/seeds/roles.seed.d.ts.map +1 -1
- package/dist/database/seeds/roles.seed.js +22 -5
- package/dist/database/seeds/roles.seed.js.map +1 -1
- package/dist/database/seeds/settings.seed.d.ts +5 -0
- package/dist/database/seeds/settings.seed.d.ts.map +1 -1
- package/dist/database/seeds/settings.seed.js +500 -25
- package/dist/database/seeds/settings.seed.js.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.d.ts +1 -0
- package/dist/database/seeds/templates/html-template.reader.d.ts.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.js +3 -1
- package/dist/database/seeds/templates/html-template.reader.js.map +1 -1
- package/dist/database/seeds/templates/html-template.reader.ts +5 -1
- package/dist/database/typeorm.util.d.ts.map +1 -1
- package/dist/database/typeorm.util.js +6 -0
- package/dist/database/typeorm.util.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -4
- package/dist/index.js.map +1 -1
- package/dist/modules/admin/controllers/admin.controller.d.ts +15 -7
- package/dist/modules/admin/controllers/admin.controller.d.ts.map +1 -1
- package/dist/modules/admin/controllers/admin.controller.js +74 -17
- package/dist/modules/admin/controllers/admin.controller.js.map +1 -1
- package/dist/modules/admin/services/admin-log.service.d.ts +14 -7
- package/dist/modules/admin/services/admin-log.service.d.ts.map +1 -1
- package/dist/modules/admin/services/admin-log.service.js +41 -38
- package/dist/modules/admin/services/admin-log.service.js.map +1 -1
- package/dist/modules/audit/audit.manifest.d.ts +8 -0
- package/dist/modules/audit/audit.manifest.d.ts.map +1 -0
- package/dist/modules/audit/audit.manifest.js +31 -0
- package/dist/modules/audit/audit.manifest.js.map +1 -0
- package/dist/modules/audit/audit.module.d.ts +8 -0
- package/dist/modules/audit/audit.module.d.ts.map +1 -0
- package/dist/modules/audit/audit.module.js +57 -0
- package/dist/modules/audit/audit.module.js.map +1 -0
- package/dist/modules/audit/constants/audit-actions.d.ts +79 -0
- package/dist/modules/audit/constants/audit-actions.d.ts.map +1 -0
- package/dist/modules/audit/constants/audit-actions.js +89 -0
- package/dist/modules/audit/constants/audit-actions.js.map +1 -0
- package/dist/modules/audit/constants/audit-mutation.d.ts +10 -0
- package/dist/modules/audit/constants/audit-mutation.d.ts.map +1 -0
- package/dist/modules/audit/constants/audit-mutation.js +13 -0
- package/dist/modules/audit/constants/audit-mutation.js.map +1 -0
- package/dist/modules/audit/controllers/audit.controller.d.ts +13 -0
- package/dist/modules/audit/controllers/audit.controller.d.ts.map +1 -0
- package/dist/modules/audit/controllers/audit.controller.js +149 -0
- package/dist/modules/audit/controllers/audit.controller.js.map +1 -0
- package/dist/modules/audit/decorators/audit.decorator.d.ts +27 -0
- package/dist/modules/audit/decorators/audit.decorator.d.ts.map +1 -0
- package/dist/modules/audit/decorators/audit.decorator.js +18 -0
- package/dist/modules/audit/decorators/audit.decorator.js.map +1 -0
- package/dist/modules/audit/dto/audit.dto.d.ts +54 -0
- package/dist/modules/audit/dto/audit.dto.d.ts.map +1 -0
- package/dist/modules/audit/dto/audit.dto.js +129 -0
- package/dist/modules/audit/dto/audit.dto.js.map +1 -0
- package/dist/modules/audit/entities/audit-event.entity.d.ts +33 -0
- package/dist/modules/audit/entities/audit-event.entity.d.ts.map +1 -0
- package/dist/modules/audit/entities/audit-event.entity.js +125 -0
- package/dist/modules/audit/entities/audit-event.entity.js.map +1 -0
- package/dist/modules/audit/entities/audit-outbox.entity.d.ts +16 -0
- package/dist/modules/audit/entities/audit-outbox.entity.d.ts.map +1 -0
- package/dist/modules/audit/entities/audit-outbox.entity.js +65 -0
- package/dist/modules/audit/entities/audit-outbox.entity.js.map +1 -0
- package/dist/modules/audit/index.d.ts +13 -0
- package/dist/modules/audit/index.d.ts.map +1 -0
- package/dist/modules/audit/index.js +23 -0
- package/dist/modules/audit/index.js.map +1 -0
- package/dist/modules/audit/interceptors/audit.interceptor.d.ts +11 -0
- package/dist/modules/audit/interceptors/audit.interceptor.d.ts.map +1 -0
- package/dist/modules/audit/interceptors/audit.interceptor.js +75 -0
- package/dist/modules/audit/interceptors/audit.interceptor.js.map +1 -0
- package/dist/modules/audit/listeners/auth-audit.listener.d.ts +31 -0
- package/dist/modules/audit/listeners/auth-audit.listener.d.ts.map +1 -0
- package/dist/modules/audit/listeners/auth-audit.listener.js +338 -0
- package/dist/modules/audit/listeners/auth-audit.listener.js.map +1 -0
- package/dist/modules/audit/services/audit-archive.service.d.ts +28 -0
- package/dist/modules/audit/services/audit-archive.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-archive.service.js +132 -0
- package/dist/modules/audit/services/audit-archive.service.js.map +1 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.d.ts +22 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.js +79 -0
- package/dist/modules/audit/services/audit-hash-backfill.service.js.map +1 -0
- package/dist/modules/audit/services/audit-leader.service.d.ts +28 -0
- package/dist/modules/audit/services/audit-leader.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-leader.service.js +99 -0
- package/dist/modules/audit/services/audit-leader.service.js.map +1 -0
- package/dist/modules/audit/services/audit-outbox.worker.d.ts +29 -0
- package/dist/modules/audit/services/audit-outbox.worker.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-outbox.worker.js +144 -0
- package/dist/modules/audit/services/audit-outbox.worker.js.map +1 -0
- package/dist/modules/audit/services/audit-partition.service.d.ts +18 -0
- package/dist/modules/audit/services/audit-partition.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-partition.service.js +70 -0
- package/dist/modules/audit/services/audit-partition.service.js.map +1 -0
- package/dist/modules/audit/services/audit-write.service.d.ts +60 -0
- package/dist/modules/audit/services/audit-write.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit-write.service.js +463 -0
- package/dist/modules/audit/services/audit-write.service.js.map +1 -0
- package/dist/modules/audit/services/audit.service.d.ts +60 -0
- package/dist/modules/audit/services/audit.service.d.ts.map +1 -0
- package/dist/modules/audit/services/audit.service.js +373 -0
- package/dist/modules/audit/services/audit.service.js.map +1 -0
- package/dist/modules/audit/utils/audit-hash.util.d.ts +20 -0
- package/dist/modules/audit/utils/audit-hash.util.d.ts.map +1 -0
- package/dist/modules/audit/utils/audit-hash.util.js +44 -0
- package/dist/modules/audit/utils/audit-hash.util.js.map +1 -0
- package/dist/modules/auth/auth-core/auth-core.module.d.ts.map +1 -1
- package/dist/modules/auth/auth-core/auth-core.module.js +16 -4
- package/dist/modules/auth/auth-core/auth-core.module.js.map +1 -1
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts +22 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js +25 -0
- package/dist/modules/auth/auth-core/constants/jwt-redis.keys.js.map +1 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.d.ts +19 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.js +110 -0
- package/dist/modules/auth/auth-core/services/access-token.validator.js.map +1 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts +10 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.js +44 -0
- package/dist/modules/auth/auth-core/services/family-denylist.reader.js.map +1 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts +10 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.d.ts.map +1 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.js +44 -0
- package/dist/modules/auth/auth-core/services/session-epoch.reader.js.map +1 -0
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts +7 -8
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.d.ts.map +1 -1
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.js +34 -34
- package/dist/modules/auth/auth-core/strategies/jwt.strategy.js.map +1 -1
- package/dist/modules/auth/auth.manifest.d.ts +6 -0
- package/dist/modules/auth/auth.manifest.d.ts.map +1 -1
- package/dist/modules/auth/auth.manifest.js +38 -2
- package/dist/modules/auth/auth.manifest.js.map +1 -1
- package/dist/modules/auth/auth.module.d.ts.map +1 -1
- package/dist/modules/auth/auth.module.js +39 -4
- package/dist/modules/auth/auth.module.js.map +1 -1
- package/dist/modules/auth/controllers/account.controller.d.ts +15 -1
- package/dist/modules/auth/controllers/account.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/account.controller.js +65 -7
- package/dist/modules/auth/controllers/account.controller.js.map +1 -1
- package/dist/modules/auth/controllers/auth.controller.d.ts +7 -3
- package/dist/modules/auth/controllers/auth.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/auth.controller.js +76 -16
- package/dist/modules/auth/controllers/auth.controller.js.map +1 -1
- package/dist/modules/auth/controllers/forgot-password.controller.d.ts +4 -2
- package/dist/modules/auth/controllers/forgot-password.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/forgot-password.controller.js +32 -11
- package/dist/modules/auth/controllers/forgot-password.controller.js.map +1 -1
- package/dist/modules/auth/controllers/mfa.controller.d.ts +18 -0
- package/dist/modules/auth/controllers/mfa.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/mfa.controller.js +192 -0
- package/dist/modules/auth/controllers/mfa.controller.js.map +1 -0
- package/dist/modules/auth/controllers/oauth.controller.d.ts +22 -0
- package/dist/modules/auth/controllers/oauth.controller.d.ts.map +1 -0
- package/dist/modules/auth/controllers/oauth.controller.js +192 -0
- package/dist/modules/auth/controllers/oauth.controller.js.map +1 -0
- package/dist/modules/auth/controllers/otp.controller.d.ts +6 -3
- package/dist/modules/auth/controllers/otp.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/otp.controller.js +32 -33
- package/dist/modules/auth/controllers/otp.controller.js.map +1 -1
- package/dist/modules/auth/controllers/pin.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/pin.controller.js +10 -2
- package/dist/modules/auth/controllers/pin.controller.js.map +1 -1
- package/dist/modules/auth/controllers/session.controller.d.ts +12 -4
- package/dist/modules/auth/controllers/session.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/session.controller.js +130 -31
- package/dist/modules/auth/controllers/session.controller.js.map +1 -1
- package/dist/modules/auth/dto/auth-config.dto.d.ts +11 -2
- package/dist/modules/auth/dto/auth-config.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/auth-config.dto.js +78 -3
- package/dist/modules/auth/dto/auth-config.dto.js.map +1 -1
- package/dist/modules/auth/dto/index.d.ts +2 -0
- package/dist/modules/auth/dto/index.d.ts.map +1 -1
- package/dist/modules/auth/dto/index.js +2 -0
- package/dist/modules/auth/dto/index.js.map +1 -1
- package/dist/modules/auth/dto/login.dto.d.ts +8 -1
- package/dist/modules/auth/dto/login.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/login.dto.js +48 -3
- package/dist/modules/auth/dto/login.dto.js.map +1 -1
- package/dist/modules/auth/dto/mfa.dto.d.ts +61 -0
- package/dist/modules/auth/dto/mfa.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/mfa.dto.js +326 -0
- package/dist/modules/auth/dto/mfa.dto.js.map +1 -0
- package/dist/modules/auth/dto/oauth.dto.d.ts +45 -0
- package/dist/modules/auth/dto/oauth.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/oauth.dto.js +249 -0
- package/dist/modules/auth/dto/oauth.dto.js.map +1 -0
- package/dist/modules/auth/dto/otp.dto.d.ts +3 -1
- package/dist/modules/auth/dto/otp.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/otp.dto.js +19 -0
- package/dist/modules/auth/dto/otp.dto.js.map +1 -1
- package/dist/modules/auth/dto/password.dto.d.ts +28 -0
- package/dist/modules/auth/dto/password.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/password.dto.js +191 -5
- package/dist/modules/auth/dto/password.dto.js.map +1 -1
- package/dist/modules/auth/dto/register.dto.d.ts +1 -0
- package/dist/modules/auth/dto/register.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/register.dto.js +1 -0
- package/dist/modules/auth/dto/register.dto.js.map +1 -1
- package/dist/modules/auth/dto/session.dto.d.ts +20 -0
- package/dist/modules/auth/dto/session.dto.d.ts.map +1 -0
- package/dist/modules/auth/dto/session.dto.js +98 -0
- package/dist/modules/auth/dto/session.dto.js.map +1 -0
- package/dist/modules/auth/dto/token.dto.d.ts +38 -1
- package/dist/modules/auth/dto/token.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/token.dto.js +21 -1
- package/dist/modules/auth/dto/token.dto.js.map +1 -1
- package/dist/modules/auth/entities/index.d.ts +2 -0
- package/dist/modules/auth/entities/index.d.ts.map +1 -1
- package/dist/modules/auth/entities/index.js +2 -0
- package/dist/modules/auth/entities/index.js.map +1 -1
- package/dist/modules/auth/entities/password-reset-token.entity.d.ts +2 -0
- package/dist/modules/auth/entities/password-reset-token.entity.d.ts.map +1 -1
- package/dist/modules/auth/entities/password-reset-token.entity.js +6 -0
- package/dist/modules/auth/entities/password-reset-token.entity.js.map +1 -1
- package/dist/modules/auth/entities/user-mfa.entity.d.ts +19 -0
- package/dist/modules/auth/entities/user-mfa.entity.d.ts.map +1 -0
- package/dist/modules/auth/entities/user-mfa.entity.js +73 -0
- package/dist/modules/auth/entities/user-mfa.entity.js.map +1 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts +24 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.d.ts.map +1 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.js +84 -0
- package/dist/modules/auth/entities/user-oauth-identity.entity.js.map +1 -0
- package/dist/modules/auth/events/auth.events.d.ts +84 -19
- package/dist/modules/auth/events/auth.events.d.ts.map +1 -1
- package/dist/modules/auth/events/auth.events.js +17 -9
- package/dist/modules/auth/events/auth.events.js.map +1 -1
- package/dist/modules/auth/services/account.service.d.ts +74 -14
- package/dist/modules/auth/services/account.service.d.ts.map +1 -1
- package/dist/modules/auth/services/account.service.js +247 -31
- package/dist/modules/auth/services/account.service.js.map +1 -1
- package/dist/modules/auth/services/dpop.service.d.ts +41 -0
- package/dist/modules/auth/services/dpop.service.d.ts.map +1 -0
- package/dist/modules/auth/services/dpop.service.js +159 -0
- package/dist/modules/auth/services/dpop.service.js.map +1 -0
- package/dist/modules/auth/services/index.d.ts +2 -0
- package/dist/modules/auth/services/index.d.ts.map +1 -1
- package/dist/modules/auth/services/index.js +2 -0
- package/dist/modules/auth/services/index.js.map +1 -1
- package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts +28 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.d.ts.map +1 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.js +163 -0
- package/dist/modules/auth/services/legacy-hash-cleanup.service.js.map +1 -0
- package/dist/modules/auth/services/login.service.d.ts +29 -34
- package/dist/modules/auth/services/login.service.d.ts.map +1 -1
- package/dist/modules/auth/services/login.service.js +173 -61
- package/dist/modules/auth/services/login.service.js.map +1 -1
- package/dist/modules/auth/services/mfa.service.d.ts +111 -0
- package/dist/modules/auth/services/mfa.service.d.ts.map +1 -0
- package/dist/modules/auth/services/mfa.service.js +662 -0
- package/dist/modules/auth/services/mfa.service.js.map +1 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts +11 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.js +56 -0
- package/dist/modules/auth/services/oauth/apple-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts +12 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.js +64 -0
- package/dist/modules/auth/services/oauth/google-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts +11 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js +76 -0
- package/dist/modules/auth/services/oauth/microsoft-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts +16 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js +92 -0
- package/dist/modules/auth/services/oauth/oidc-id-token.verifier.js.map +1 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts +9 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.js +3 -0
- package/dist/modules/auth/services/oauth/verified-oauth-identity.js.map +1 -0
- package/dist/modules/auth/services/oauth.service.d.ts +83 -0
- package/dist/modules/auth/services/oauth.service.d.ts.map +1 -0
- package/dist/modules/auth/services/oauth.service.js +471 -0
- package/dist/modules/auth/services/oauth.service.js.map +1 -0
- package/dist/modules/auth/services/otp-auth.service.d.ts +13 -3
- package/dist/modules/auth/services/otp-auth.service.d.ts.map +1 -1
- package/dist/modules/auth/services/otp-auth.service.js +41 -7
- package/dist/modules/auth/services/otp-auth.service.js.map +1 -1
- package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts +22 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.d.ts.map +1 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.js +117 -0
- package/dist/modules/auth/services/password-reset-audit-retention.service.js.map +1 -0
- package/dist/modules/auth/services/password.service.d.ts +25 -5
- package/dist/modules/auth/services/password.service.d.ts.map +1 -1
- package/dist/modules/auth/services/password.service.js +154 -20
- package/dist/modules/auth/services/password.service.js.map +1 -1
- package/dist/modules/auth/services/pin-auth.service.d.ts +10 -3
- package/dist/modules/auth/services/pin-auth.service.d.ts.map +1 -1
- package/dist/modules/auth/services/pin-auth.service.js +110 -13
- package/dist/modules/auth/services/pin-auth.service.js.map +1 -1
- package/dist/modules/auth/services/registration.service.d.ts +10 -2
- package/dist/modules/auth/services/registration.service.d.ts.map +1 -1
- package/dist/modules/auth/services/registration.service.js +113 -25
- package/dist/modules/auth/services/registration.service.js.map +1 -1
- package/dist/modules/auth/services/turnstile.service.d.ts +17 -0
- package/dist/modules/auth/services/turnstile.service.d.ts.map +1 -0
- package/dist/modules/auth/services/turnstile.service.js +94 -0
- package/dist/modules/auth/services/turnstile.service.js.map +1 -0
- package/dist/modules/auth/utils/auth-params.util.d.ts +13 -6
- package/dist/modules/auth/utils/auth-params.util.d.ts.map +1 -1
- package/dist/modules/auth/utils/auth-params.util.js +27 -4
- package/dist/modules/auth/utils/auth-params.util.js.map +1 -1
- package/dist/modules/auth/utils/auth-supported.util.d.ts +12 -1
- package/dist/modules/auth/utils/auth-supported.util.d.ts.map +1 -1
- package/dist/modules/auth/utils/auth-supported.util.js +36 -4
- package/dist/modules/auth/utils/auth-supported.util.js.map +1 -1
- package/dist/modules/auth/utils/backup-code-hash.util.d.ts +10 -0
- package/dist/modules/auth/utils/backup-code-hash.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/backup-code-hash.util.js +31 -0
- package/dist/modules/auth/utils/backup-code-hash.util.js.map +1 -0
- package/dist/modules/auth/utils/backup-codes.util.d.ts +5 -0
- package/dist/modules/auth/utils/backup-codes.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/backup-codes.util.js +22 -0
- package/dist/modules/auth/utils/backup-codes.util.js.map +1 -0
- package/dist/modules/auth/utils/dpop.util.d.ts +22 -0
- package/dist/modules/auth/utils/dpop.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/dpop.util.js +73 -0
- package/dist/modules/auth/utils/dpop.util.js.map +1 -0
- package/dist/modules/auth/utils/mfa-secret.util.d.ts +22 -0
- package/dist/modules/auth/utils/mfa-secret.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/mfa-secret.util.js +59 -0
- package/dist/modules/auth/utils/mfa-secret.util.js.map +1 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.d.ts +26 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.js +49 -0
- package/dist/modules/auth/utils/mfa-verify-params.util.js.map +1 -0
- package/dist/modules/auth/utils/step-up-purpose.util.d.ts +5 -0
- package/dist/modules/auth/utils/step-up-purpose.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/step-up-purpose.util.js +18 -0
- package/dist/modules/auth/utils/step-up-purpose.util.js.map +1 -0
- package/dist/modules/auth/utils/totp.util.d.ts +16 -0
- package/dist/modules/auth/utils/totp.util.d.ts.map +1 -0
- package/dist/modules/auth/utils/totp.util.js +88 -0
- package/dist/modules/auth/utils/totp.util.js.map +1 -0
- package/dist/modules/delivery/composers/otp-delivery.composer.d.ts +28 -1
- package/dist/modules/delivery/composers/otp-delivery.composer.d.ts.map +1 -1
- package/dist/modules/delivery/composers/otp-delivery.composer.js +48 -2
- package/dist/modules/delivery/composers/otp-delivery.composer.js.map +1 -1
- package/dist/modules/delivery/constants/delivery-worker.constants.d.ts +29 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.d.ts.map +1 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.js +51 -0
- package/dist/modules/delivery/constants/delivery-worker.constants.js.map +1 -0
- package/dist/modules/delivery/delivery.module.d.ts.map +1 -1
- package/dist/modules/delivery/delivery.module.js +1 -15
- package/dist/modules/delivery/delivery.module.js.map +1 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.d.ts.map +1 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.js +3 -1
- package/dist/modules/delivery/entities/notification-delivery-log.entity.js.map +1 -1
- package/dist/modules/delivery/notification-delivery.service.d.ts +12 -1
- package/dist/modules/delivery/notification-delivery.service.d.ts.map +1 -1
- package/dist/modules/delivery/notification-delivery.service.js +121 -40
- package/dist/modules/delivery/notification-delivery.service.js.map +1 -1
- package/dist/modules/delivery/processors/delivery-job.runner.d.ts +22 -1
- package/dist/modules/delivery/processors/delivery-job.runner.d.ts.map +1 -1
- package/dist/modules/delivery/processors/delivery-job.runner.js +144 -42
- package/dist/modules/delivery/processors/delivery-job.runner.js.map +1 -1
- package/dist/modules/delivery/processors/delivery.processor.d.ts.map +1 -1
- package/dist/modules/delivery/processors/delivery.processor.js +6 -1
- package/dist/modules/delivery/processors/delivery.processor.js.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts +11 -0
- package/dist/modules/delivery/processors/otp-delivery-job.runner.d.ts.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery-job.runner.js +90 -16
- package/dist/modules/delivery/processors/otp-delivery-job.runner.js.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.d.ts.map +1 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.js +6 -1
- package/dist/modules/delivery/processors/otp-delivery.processor.js.map +1 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.d.ts +7 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.d.ts.map +1 -1
- package/dist/modules/delivery/queues/sync-jobs.queue.js +11 -2
- package/dist/modules/delivery/queues/sync-jobs.queue.js.map +1 -1
- package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts +7 -3
- package/dist/modules/delivery/services/delivery-audit-retention.service.d.ts.map +1 -1
- package/dist/modules/delivery/services/delivery-audit-retention.service.js +33 -10
- package/dist/modules/delivery/services/delivery-audit-retention.service.js.map +1 -1
- package/dist/modules/delivery/services/notification-audit.service.d.ts +7 -4
- package/dist/modules/delivery/services/notification-audit.service.d.ts.map +1 -1
- package/dist/modules/delivery/services/notification-audit.service.js +83 -26
- package/dist/modules/delivery/services/notification-audit.service.js.map +1 -1
- package/dist/modules/delivery/utils/payload-snapshot.util.d.ts +2 -0
- package/dist/modules/delivery/utils/payload-snapshot.util.d.ts.map +1 -1
- package/dist/modules/delivery/utils/payload-snapshot.util.js +22 -3
- package/dist/modules/delivery/utils/payload-snapshot.util.js.map +1 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.d.ts +7 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.d.ts.map +1 -1
- package/dist/modules/file-upload/controllers/file-upload.controller.js +5 -7
- package/dist/modules/file-upload/controllers/file-upload.controller.js.map +1 -1
- package/dist/modules/file-upload/dto/file-upload.dto.d.ts +2 -0
- package/dist/modules/file-upload/dto/file-upload.dto.d.ts.map +1 -1
- package/dist/modules/file-upload/dto/file-upload.dto.js +20 -0
- package/dist/modules/file-upload/dto/file-upload.dto.js.map +1 -1
- package/dist/modules/file-upload/file-upload.module.d.ts.map +1 -1
- package/dist/modules/file-upload/file-upload.module.js +12 -2
- package/dist/modules/file-upload/file-upload.module.js.map +1 -1
- package/dist/modules/file-upload/services/file-upload.service.d.ts +24 -6
- package/dist/modules/file-upload/services/file-upload.service.d.ts.map +1 -1
- package/dist/modules/file-upload/services/file-upload.service.js +164 -36
- package/dist/modules/file-upload/services/file-upload.service.js.map +1 -1
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts +4 -2
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.d.ts.map +1 -1
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js +30 -5
- package/dist/modules/file-upload/services/upload-orphan-cleanup.service.js.map +1 -1
- package/dist/modules/file-upload/utils/image-optimize.util.d.ts.map +1 -1
- package/dist/modules/file-upload/utils/image-optimize.util.js +7 -1
- package/dist/modules/file-upload/utils/image-optimize.util.js.map +1 -1
- package/dist/modules/health/health.controller.d.ts +5 -1
- package/dist/modules/health/health.controller.d.ts.map +1 -1
- package/dist/modules/health/health.controller.js +57 -3
- package/dist/modules/health/health.controller.js.map +1 -1
- package/dist/modules/invitations/controllers/invitations.controller.d.ts +19 -4
- package/dist/modules/invitations/controllers/invitations.controller.d.ts.map +1 -1
- package/dist/modules/invitations/controllers/invitations.controller.js +19 -10
- package/dist/modules/invitations/controllers/invitations.controller.js.map +1 -1
- package/dist/modules/invitations/dto/invitation.dto.d.ts +13 -0
- package/dist/modules/invitations/dto/invitation.dto.d.ts.map +1 -1
- package/dist/modules/invitations/dto/invitation.dto.js +69 -2
- package/dist/modules/invitations/dto/invitation.dto.js.map +1 -1
- package/dist/modules/invitations/services/invitations.service.d.ts +24 -6
- package/dist/modules/invitations/services/invitations.service.d.ts.map +1 -1
- package/dist/modules/invitations/services/invitations.service.js +96 -20
- package/dist/modules/invitations/services/invitations.service.js.map +1 -1
- package/dist/modules/jobs/queues/jobs.queue.d.ts +7 -2
- package/dist/modules/jobs/queues/jobs.queue.d.ts.map +1 -1
- package/dist/modules/jobs/queues/jobs.queue.js +25 -10
- package/dist/modules/jobs/queues/jobs.queue.js.map +1 -1
- package/dist/modules/notifications/controllers/notifications.controller.d.ts +3 -1
- package/dist/modules/notifications/controllers/notifications.controller.d.ts.map +1 -1
- package/dist/modules/notifications/controllers/notifications.controller.js +25 -2
- package/dist/modules/notifications/controllers/notifications.controller.js.map +1 -1
- package/dist/modules/notifications/dto/notification-query.dto.d.ts.map +1 -1
- package/dist/modules/notifications/dto/notification-query.dto.js +1 -0
- package/dist/modules/notifications/dto/notification-query.dto.js.map +1 -1
- package/dist/modules/notifications/entities/device-token.entity.d.ts.map +1 -1
- package/dist/modules/notifications/entities/device-token.entity.js +3 -1
- package/dist/modules/notifications/entities/device-token.entity.js.map +1 -1
- package/dist/modules/notifications/services/fcm.service.d.ts +2 -0
- package/dist/modules/notifications/services/fcm.service.d.ts.map +1 -1
- package/dist/modules/notifications/services/fcm.service.js +28 -7
- package/dist/modules/notifications/services/fcm.service.js.map +1 -1
- package/dist/modules/notifications/services/notifications.service.d.ts +16 -3
- package/dist/modules/notifications/services/notifications.service.d.ts.map +1 -1
- package/dist/modules/notifications/services/notifications.service.js +95 -24
- package/dist/modules/notifications/services/notifications.service.js.map +1 -1
- package/dist/modules/observability/metrics/metrics.service.d.ts +2 -0
- package/dist/modules/observability/metrics/metrics.service.d.ts.map +1 -1
- package/dist/modules/observability/metrics/metrics.service.js +11 -0
- package/dist/modules/observability/metrics/metrics.service.js.map +1 -1
- package/dist/modules/otp/constants/otp.constants.d.ts +7 -5
- package/dist/modules/otp/constants/otp.constants.d.ts.map +1 -1
- package/dist/modules/otp/constants/otp.constants.js +11 -8
- package/dist/modules/otp/constants/otp.constants.js.map +1 -1
- package/dist/modules/otp/interfaces/otp.service.interface.d.ts +1 -1
- package/dist/modules/otp/interfaces/otp.service.interface.d.ts.map +1 -1
- package/dist/modules/otp/otp.service.d.ts +10 -2
- package/dist/modules/otp/otp.service.d.ts.map +1 -1
- package/dist/modules/otp/otp.service.js +48 -4
- package/dist/modules/otp/otp.service.js.map +1 -1
- package/dist/modules/otp/services/otp.rate-limiter.d.ts +2 -0
- package/dist/modules/otp/services/otp.rate-limiter.d.ts.map +1 -1
- package/dist/modules/otp/services/otp.rate-limiter.js +19 -0
- package/dist/modules/otp/services/otp.rate-limiter.js.map +1 -1
- package/dist/modules/otp/services/otp.session.store.d.ts +9 -3
- package/dist/modules/otp/services/otp.session.store.d.ts.map +1 -1
- package/dist/modules/otp/services/otp.session.store.js +34 -42
- package/dist/modules/otp/services/otp.session.store.js.map +1 -1
- package/dist/modules/otp/utils/otp-code-hash.util.d.ts +11 -0
- package/dist/modules/otp/utils/otp-code-hash.util.d.ts.map +1 -0
- package/dist/modules/otp/utils/otp-code-hash.util.js +68 -0
- package/dist/modules/otp/utils/otp-code-hash.util.js.map +1 -0
- package/dist/modules/profile/controllers/profile.controller.d.ts +9 -3
- package/dist/modules/profile/controllers/profile.controller.d.ts.map +1 -1
- package/dist/modules/profile/controllers/profile.controller.js +140 -8
- package/dist/modules/profile/controllers/profile.controller.js.map +1 -1
- package/dist/modules/profile/dto/create-user-profile.dto.d.ts +10 -0
- package/dist/modules/profile/dto/create-user-profile.dto.d.ts.map +1 -1
- package/dist/modules/profile/dto/create-user-profile.dto.js +43 -1
- package/dist/modules/profile/dto/create-user-profile.dto.js.map +1 -1
- package/dist/modules/profile/dto/public-user-profile.dto.d.ts +24 -0
- package/dist/modules/profile/dto/public-user-profile.dto.d.ts.map +1 -0
- package/dist/modules/profile/dto/public-user-profile.dto.js +115 -0
- package/dist/modules/profile/dto/public-user-profile.dto.js.map +1 -0
- package/dist/modules/profile/dto/user-profile-response.dto.d.ts +4 -0
- package/dist/modules/profile/dto/user-profile-response.dto.d.ts.map +1 -1
- package/dist/modules/profile/dto/user-profile-response.dto.js +4 -0
- package/dist/modules/profile/dto/user-profile-response.dto.js.map +1 -1
- package/dist/modules/profile/dto/username-available.dto.d.ts +6 -0
- package/dist/modules/profile/dto/username-available.dto.d.ts.map +1 -0
- package/dist/modules/profile/dto/username-available.dto.js +31 -0
- package/dist/modules/profile/dto/username-available.dto.js.map +1 -0
- package/dist/modules/profile/entities/user-profiles.entity.d.ts +10 -0
- package/dist/modules/profile/entities/user-profiles.entity.d.ts.map +1 -1
- package/dist/modules/profile/entities/user-profiles.entity.js +29 -1
- package/dist/modules/profile/entities/user-profiles.entity.js.map +1 -1
- package/dist/modules/profile/index.d.ts +1 -0
- package/dist/modules/profile/index.d.ts.map +1 -1
- package/dist/modules/profile/index.js +1 -0
- package/dist/modules/profile/index.js.map +1 -1
- package/dist/modules/profile/profile.manifest.d.ts +2 -2
- package/dist/modules/profile/profile.manifest.js +2 -2
- package/dist/modules/profile/profile.manifest.js.map +1 -1
- package/dist/modules/profile/profile.module.d.ts.map +1 -1
- package/dist/modules/profile/profile.module.js +7 -2
- package/dist/modules/profile/profile.module.js.map +1 -1
- package/dist/modules/profile/services/profile.service.d.ts +56 -4
- package/dist/modules/profile/services/profile.service.d.ts.map +1 -1
- package/dist/modules/profile/services/profile.service.js +247 -20
- package/dist/modules/profile/services/profile.service.js.map +1 -1
- package/dist/modules/realtime/adapters/redis-io.adapter.d.ts +26 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.d.ts.map +1 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.js +124 -0
- package/dist/modules/realtime/adapters/redis-io.adapter.js.map +1 -0
- package/dist/modules/realtime/constants/realtime.constants.d.ts +36 -0
- package/dist/modules/realtime/constants/realtime.constants.d.ts.map +1 -0
- package/dist/modules/realtime/constants/realtime.constants.js +42 -0
- package/dist/modules/realtime/constants/realtime.constants.js.map +1 -0
- package/dist/modules/realtime/controllers/realtime.controller.d.ts +21 -0
- package/dist/modules/realtime/controllers/realtime.controller.d.ts.map +1 -0
- package/dist/modules/realtime/controllers/realtime.controller.js +113 -0
- package/dist/modules/realtime/controllers/realtime.controller.js.map +1 -0
- package/dist/modules/realtime/gateway/realtime.gateway.d.ts +42 -0
- package/dist/modules/realtime/gateway/realtime.gateway.d.ts.map +1 -0
- package/dist/modules/realtime/gateway/realtime.gateway.js +289 -0
- package/dist/modules/realtime/gateway/realtime.gateway.js.map +1 -0
- package/dist/modules/realtime/index.d.ts +12 -0
- package/dist/modules/realtime/index.d.ts.map +1 -0
- package/dist/modules/realtime/index.js +35 -0
- package/dist/modules/realtime/index.js.map +1 -0
- package/dist/modules/realtime/realtime.manifest.d.ts +8 -0
- package/dist/modules/realtime/realtime.manifest.d.ts.map +1 -0
- package/dist/modules/realtime/realtime.manifest.js +31 -0
- package/dist/modules/realtime/realtime.manifest.js.map +1 -0
- package/dist/modules/realtime/realtime.module.d.ts +14 -0
- package/dist/modules/realtime/realtime.module.d.ts.map +1 -0
- package/dist/modules/realtime/realtime.module.js +126 -0
- package/dist/modules/realtime/realtime.module.js.map +1 -0
- package/dist/modules/realtime/services/realtime-handler.registry.d.ts +16 -0
- package/dist/modules/realtime/services/realtime-handler.registry.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-handler.registry.js +55 -0
- package/dist/modules/realtime/services/realtime-handler.registry.js.map +1 -0
- package/dist/modules/realtime/services/realtime-presence.service.d.ts +15 -0
- package/dist/modules/realtime/services/realtime-presence.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-presence.service.js +86 -0
- package/dist/modules/realtime/services/realtime-presence.service.js.map +1 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts +12 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.js +63 -0
- package/dist/modules/realtime/services/realtime-rate-limiter.service.js.map +1 -0
- package/dist/modules/realtime/services/realtime.service.d.ts +88 -0
- package/dist/modules/realtime/services/realtime.service.d.ts.map +1 -0
- package/dist/modules/realtime/services/realtime.service.js +343 -0
- package/dist/modules/realtime/services/realtime.service.js.map +1 -0
- package/dist/modules/realtime/types/realtime.types.d.ts +50 -0
- package/dist/modules/realtime/types/realtime.types.d.ts.map +1 -0
- package/dist/modules/realtime/types/realtime.types.js +14 -0
- package/dist/modules/realtime/types/realtime.types.js.map +1 -0
- package/dist/modules/realtime/utils/handshake-error.util.d.ts +5 -0
- package/dist/modules/realtime/utils/handshake-error.util.d.ts.map +1 -0
- package/dist/modules/realtime/utils/handshake-error.util.js +45 -0
- package/dist/modules/realtime/utils/handshake-error.util.js.map +1 -0
- package/dist/modules/roles/controllers/modules.controller.d.ts +4 -3
- package/dist/modules/roles/controllers/modules.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/modules.controller.js +21 -10
- package/dist/modules/roles/controllers/modules.controller.js.map +1 -1
- package/dist/modules/roles/controllers/permissions.controller.d.ts +4 -3
- package/dist/modules/roles/controllers/permissions.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/permissions.controller.js +21 -10
- package/dist/modules/roles/controllers/permissions.controller.js.map +1 -1
- package/dist/modules/roles/controllers/roles.controller.d.ts +5 -4
- package/dist/modules/roles/controllers/roles.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/roles.controller.js +26 -13
- package/dist/modules/roles/controllers/roles.controller.js.map +1 -1
- package/dist/modules/roles/controllers/user-roles.controller.d.ts +3 -2
- package/dist/modules/roles/controllers/user-roles.controller.d.ts.map +1 -1
- package/dist/modules/roles/controllers/user-roles.controller.js +14 -6
- package/dist/modules/roles/controllers/user-roles.controller.js.map +1 -1
- package/dist/modules/roles/services/modules.service.d.ts +8 -5
- package/dist/modules/roles/services/modules.service.d.ts.map +1 -1
- package/dist/modules/roles/services/modules.service.js +58 -12
- package/dist/modules/roles/services/modules.service.js.map +1 -1
- package/dist/modules/roles/services/permissions.service.d.ts +8 -5
- package/dist/modules/roles/services/permissions.service.d.ts.map +1 -1
- package/dist/modules/roles/services/permissions.service.js +61 -12
- package/dist/modules/roles/services/permissions.service.js.map +1 -1
- package/dist/modules/roles/services/roles.service.d.ts +19 -9
- package/dist/modules/roles/services/roles.service.d.ts.map +1 -1
- package/dist/modules/roles/services/roles.service.js +137 -47
- package/dist/modules/roles/services/roles.service.js.map +1 -1
- package/dist/modules/roles/services/user-roles.service.d.ts +12 -4
- package/dist/modules/roles/services/user-roles.service.d.ts.map +1 -1
- package/dist/modules/roles/services/user-roles.service.js +58 -26
- package/dist/modules/roles/services/user-roles.service.js.map +1 -1
- package/dist/modules/sessions/entities/refresh-token.entity.d.ts +7 -1
- package/dist/modules/sessions/entities/refresh-token.entity.d.ts.map +1 -1
- package/dist/modules/sessions/entities/refresh-token.entity.js +10 -0
- package/dist/modules/sessions/entities/refresh-token.entity.js.map +1 -1
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts +12 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.d.ts.map +1 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.js +46 -0
- package/dist/modules/sessions/entities/revoked-refresh-family.entity.js.map +1 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.d.ts +20 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.d.ts.map +1 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.js +97 -0
- package/dist/modules/sessions/services/refresh-token-retention.service.js.map +1 -0
- package/dist/modules/sessions/services/token.service.d.ts +150 -16
- package/dist/modules/sessions/services/token.service.d.ts.map +1 -1
- package/dist/modules/sessions/services/token.service.js +505 -74
- package/dist/modules/sessions/services/token.service.js.map +1 -1
- package/dist/modules/sessions/sessions.module.d.ts.map +1 -1
- package/dist/modules/sessions/sessions.module.js +4 -2
- package/dist/modules/sessions/sessions.module.js.map +1 -1
- package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts +13 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.d.ts.map +1 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.js +37 -0
- package/dist/modules/sessions/utils/refresh-token-hash.util.js.map +1 -0
- package/dist/modules/settings/constants/settings.defaults.d.ts +57 -3
- package/dist/modules/settings/constants/settings.defaults.d.ts.map +1 -1
- package/dist/modules/settings/constants/settings.defaults.js +58 -3
- package/dist/modules/settings/constants/settings.defaults.js.map +1 -1
- package/dist/modules/settings/constants/settings.keys.d.ts +138 -2
- package/dist/modules/settings/constants/settings.keys.d.ts.map +1 -1
- package/dist/modules/settings/constants/settings.keys.js +140 -2
- package/dist/modules/settings/constants/settings.keys.js.map +1 -1
- package/dist/modules/settings/controllers/settings.controller.d.ts +5 -1
- package/dist/modules/settings/controllers/settings.controller.d.ts.map +1 -1
- package/dist/modules/settings/controllers/settings.controller.js +134 -5
- package/dist/modules/settings/controllers/settings.controller.js.map +1 -1
- package/dist/modules/settings/services/settings.service.d.ts +17 -7
- package/dist/modules/settings/services/settings.service.d.ts.map +1 -1
- package/dist/modules/settings/services/settings.service.js +80 -14
- package/dist/modules/settings/services/settings.service.js.map +1 -1
- package/dist/modules/settings/utils/settings-secret.util.d.ts +13 -0
- package/dist/modules/settings/utils/settings-secret.util.d.ts.map +1 -0
- package/dist/modules/settings/utils/settings-secret.util.js +80 -0
- package/dist/modules/settings/utils/settings-secret.util.js.map +1 -0
- package/dist/modules/users/controllers/users.controller.d.ts +4 -2
- package/dist/modules/users/controllers/users.controller.d.ts.map +1 -1
- package/dist/modules/users/controllers/users.controller.js +89 -10
- package/dist/modules/users/controllers/users.controller.js.map +1 -1
- package/dist/modules/users/dto/user.dto.d.ts +3 -0
- package/dist/modules/users/dto/user.dto.d.ts.map +1 -1
- package/dist/modules/users/dto/user.dto.js +27 -4
- package/dist/modules/users/dto/user.dto.js.map +1 -1
- package/dist/modules/users/entities/user.entity.d.ts +7 -1
- package/dist/modules/users/entities/user.entity.d.ts.map +1 -1
- package/dist/modules/users/entities/user.entity.js +10 -0
- package/dist/modules/users/entities/user.entity.js.map +1 -1
- package/dist/modules/users/services/users.service.d.ts +15 -2
- package/dist/modules/users/services/users.service.d.ts.map +1 -1
- package/dist/modules/users/services/users.service.js +152 -37
- package/dist/modules/users/services/users.service.js.map +1 -1
- package/dist/modules/users/users.module.d.ts.map +1 -1
- package/dist/modules/users/users.module.js +1 -2
- package/dist/modules/users/users.module.js.map +1 -1
- package/package.json +19 -7
- package/dist/modules/admin/entities/admin-log.entity.d.ts +0 -20
- package/dist/modules/admin/entities/admin-log.entity.d.ts.map +0 -1
- package/dist/modules/admin/entities/admin-log.entity.js +0 -65
- package/dist/modules/admin/entities/admin-log.entity.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestUser } from '../../../common/interfaces/request-user';
|
|
2
|
-
import { ChangePasswordDto, DeleteAccountConfirmDto, VerifyEmailDto } from '../dto/password.dto';
|
|
2
|
+
import { ChangeEmailDto, ChangePasswordDto, DeleteAccountConfirmDto, SetPasswordDto, VerifyEmailDto } from '../dto/password.dto';
|
|
3
3
|
import { AccountService } from '../services/account.service';
|
|
4
4
|
import { PasswordService } from '../services/password.service';
|
|
5
5
|
export declare class AccountController {
|
|
@@ -9,12 +9,25 @@ export declare class AccountController {
|
|
|
9
9
|
verifyEmail(user: RequestUser, body: VerifyEmailDto): Promise<{
|
|
10
10
|
message: string;
|
|
11
11
|
}>;
|
|
12
|
+
changeEmail(user: RequestUser, body: ChangeEmailDto): Promise<{
|
|
13
|
+
message: string;
|
|
14
|
+
}>;
|
|
12
15
|
changePassword(user: RequestUser, body: ChangePasswordDto): Promise<{
|
|
13
16
|
message: string;
|
|
14
17
|
}>;
|
|
18
|
+
setPassword(user: RequestUser, body: SetPasswordDto): Promise<{
|
|
19
|
+
message: string;
|
|
20
|
+
}>;
|
|
15
21
|
requestDeletion(user: RequestUser): Promise<{
|
|
16
22
|
message: string;
|
|
17
23
|
requiresPassword: boolean;
|
|
24
|
+
requiresOAuth?: undefined;
|
|
25
|
+
verificationId?: undefined;
|
|
26
|
+
expiresAt?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
message: string;
|
|
29
|
+
requiresOAuth: boolean;
|
|
30
|
+
requiresPassword?: undefined;
|
|
18
31
|
verificationId?: undefined;
|
|
19
32
|
expiresAt?: undefined;
|
|
20
33
|
} | {
|
|
@@ -22,6 +35,7 @@ export declare class AccountController {
|
|
|
22
35
|
verificationId: string;
|
|
23
36
|
expiresAt: number;
|
|
24
37
|
requiresPassword?: undefined;
|
|
38
|
+
requiresOAuth?: undefined;
|
|
25
39
|
}>;
|
|
26
40
|
confirmDeletion(user: RequestUser, dto: DeleteAccountConfirmDto): Promise<{
|
|
27
41
|
message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/account.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"account.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/account.controller.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAGtE,OAAO,EACN,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,qBAIa,iBAAiB;IAE5B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,eAAe;gBADf,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe;IAqBlD,WAAW,CAAgB,IAAI,EAAE,WAAW,EAAU,IAAI,EAAE,cAAc;;;IAe1E,WAAW,CACK,IAAI,EAAE,WAAW,EACC,IAAI,EAAE,cAAc;;;IAwBtD,cAAc,CACE,IAAI,EAAE,WAAW,EACC,IAAI,EAAE,iBAAiB;;;IAmBzD,WAAW,CACK,IAAI,EAAE,WAAW,EACC,IAAI,EAAE,cAAc;;;IAwBtD,eAAe,CAAgB,IAAI,EAAE,WAAW;;;;;;;;;;;;;;;;;;;IAmBhD,eAAe,CACC,IAAI,EAAE,WAAW,EACC,GAAG,EAAE,uBAAuB;;;CAI9D"}
|
|
@@ -17,7 +17,9 @@ const common_1 = require("@nestjs/common");
|
|
|
17
17
|
const swagger_1 = require("@nestjs/swagger");
|
|
18
18
|
const decorators_1 = require("../../../common/decorators");
|
|
19
19
|
const auth_guard_1 = require("../../../common/guards/auth.guard");
|
|
20
|
+
const permissions_guard_1 = require("../../../common/guards/permissions.guard");
|
|
20
21
|
const config_aware_validation_pipe_1 = require("../../../common/pipes/config-aware-validation.pipe");
|
|
22
|
+
const auth_manifest_1 = require("../auth.manifest");
|
|
21
23
|
const password_dto_1 = require("../dto/password.dto");
|
|
22
24
|
const account_service_1 = require("../services/account.service");
|
|
23
25
|
const password_service_1 = require("../services/password.service");
|
|
@@ -32,10 +34,16 @@ let AccountController = class AccountController {
|
|
|
32
34
|
verifyEmail(user, body) {
|
|
33
35
|
return this.accountService.verifyEmail(user.id, body.verificationToken);
|
|
34
36
|
}
|
|
37
|
+
changeEmail(user, body) {
|
|
38
|
+
return this.accountService.changeEmail(user.id, body);
|
|
39
|
+
}
|
|
35
40
|
// ─── Password ─────────────────────────────────────────────────────────────
|
|
36
41
|
changePassword(user, body) {
|
|
37
42
|
return this.passwordService.changePassword(user.id, body);
|
|
38
43
|
}
|
|
44
|
+
setPassword(user, body) {
|
|
45
|
+
return this.passwordService.setPassword(user.id, body);
|
|
46
|
+
}
|
|
39
47
|
// ─── Account Deletion (two-step) ──────────────────────────────────────────
|
|
40
48
|
requestDeletion(user) {
|
|
41
49
|
return this.accountService.requestDeletion(user.id);
|
|
@@ -47,6 +55,7 @@ let AccountController = class AccountController {
|
|
|
47
55
|
exports.AccountController = AccountController;
|
|
48
56
|
__decorate([
|
|
49
57
|
(0, common_1.Post)('verify-email'),
|
|
58
|
+
(0, decorators_1.RequirePermission)(auth_manifest_1.AUTH_PERMISSIONS.PASSWORD_MANAGE),
|
|
50
59
|
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
51
60
|
(0, swagger_1.ApiOperation)({
|
|
52
61
|
summary: 'Verify email address',
|
|
@@ -66,29 +75,73 @@ __decorate([
|
|
|
66
75
|
__metadata("design:paramtypes", [Object, password_dto_1.VerifyEmailDto]),
|
|
67
76
|
__metadata("design:returntype", void 0)
|
|
68
77
|
], AccountController.prototype, "verifyEmail", null);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, common_1.Post)('account/change-email'),
|
|
80
|
+
(0, decorators_1.RequirePermission)(auth_manifest_1.AUTH_PERMISSIONS.PASSWORD_MANAGE),
|
|
81
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
82
|
+
(0, swagger_1.ApiOperation)({
|
|
83
|
+
summary: 'Change email address',
|
|
84
|
+
description: 'OTP-gated. Send OTP to the **new** email via POST /auth/send-otp, then confirm here. ' +
|
|
85
|
+
'When MFA is enabled, pass stepUpToken from POST /auth/mfa/step-up.',
|
|
86
|
+
}),
|
|
87
|
+
(0, swagger_1.ApiBody)({ type: password_dto_1.ChangeEmailDto }),
|
|
88
|
+
(0, swagger_1.ApiOkResponse)({ schema: { example: { message: 'Email address updated and verified.' } } }),
|
|
89
|
+
__param(0, (0, decorators_1.CurrentUser)()),
|
|
90
|
+
__param(1, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
91
|
+
__metadata("design:type", Function),
|
|
92
|
+
__metadata("design:paramtypes", [Object, password_dto_1.ChangeEmailDto]),
|
|
93
|
+
__metadata("design:returntype", void 0)
|
|
94
|
+
], AccountController.prototype, "changeEmail", null);
|
|
69
95
|
__decorate([
|
|
70
96
|
(0, common_1.Post)('account/change-password'),
|
|
97
|
+
(0, decorators_1.RequirePermission)(auth_manifest_1.AUTH_PERMISSIONS.PASSWORD_MANAGE),
|
|
71
98
|
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
72
99
|
(0, swagger_1.ApiOperation)({
|
|
73
100
|
summary: 'Change password',
|
|
74
|
-
description: 'Change password for the authenticated user.'
|
|
101
|
+
description: 'Change password for the authenticated user. Revokes all sessions. ' +
|
|
102
|
+
'When MFA is enabled, pass stepUpToken from POST /auth/mfa/step-up.',
|
|
75
103
|
}),
|
|
76
104
|
(0, swagger_1.ApiBody)({ type: password_dto_1.ChangePasswordDto }),
|
|
77
|
-
(0, swagger_1.ApiOkResponse)({
|
|
105
|
+
(0, swagger_1.ApiOkResponse)({
|
|
106
|
+
schema: {
|
|
107
|
+
example: { message: 'Password changed successfully. All sessions have been revoked.' },
|
|
108
|
+
},
|
|
109
|
+
}),
|
|
78
110
|
(0, swagger_1.ApiUnauthorizedResponse)({ description: 'Current password is incorrect' }),
|
|
79
|
-
(0, swagger_1.ApiBadRequestResponse)({ description: 'Account has no password
|
|
111
|
+
(0, swagger_1.ApiBadRequestResponse)({ description: 'Account has no password — use set-password' }),
|
|
80
112
|
__param(0, (0, decorators_1.CurrentUser)()),
|
|
81
|
-
__param(1, (0, common_1.Body)()),
|
|
113
|
+
__param(1, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
82
114
|
__metadata("design:type", Function),
|
|
83
115
|
__metadata("design:paramtypes", [Object, password_dto_1.ChangePasswordDto]),
|
|
84
116
|
__metadata("design:returntype", void 0)
|
|
85
117
|
], AccountController.prototype, "changePassword", null);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, common_1.Post)('account/set-password'),
|
|
120
|
+
(0, decorators_1.RequirePermission)(auth_manifest_1.AUTH_PERMISSIONS.PASSWORD_MANAGE),
|
|
121
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
122
|
+
(0, swagger_1.ApiOperation)({
|
|
123
|
+
summary: 'Set password (first time)',
|
|
124
|
+
description: 'For OAuth/phone accounts with no password yet. Does not change authMethod — password becomes an additional login factor. ' +
|
|
125
|
+
'Requires an email on the account. Revokes all sessions. When MFA is enabled, pass stepUpToken.',
|
|
126
|
+
}),
|
|
127
|
+
(0, swagger_1.ApiBody)({ type: password_dto_1.SetPasswordDto }),
|
|
128
|
+
(0, swagger_1.ApiOkResponse)({
|
|
129
|
+
schema: { example: { message: 'Password set successfully.' } },
|
|
130
|
+
}),
|
|
131
|
+
(0, swagger_1.ApiConflictResponse)({ description: 'Password already set — use change-password' }),
|
|
132
|
+
__param(0, (0, decorators_1.CurrentUser)()),
|
|
133
|
+
__param(1, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
134
|
+
__metadata("design:type", Function),
|
|
135
|
+
__metadata("design:paramtypes", [Object, password_dto_1.SetPasswordDto]),
|
|
136
|
+
__metadata("design:returntype", void 0)
|
|
137
|
+
], AccountController.prototype, "setPassword", null);
|
|
86
138
|
__decorate([
|
|
87
139
|
(0, common_1.Post)('account/delete-request'),
|
|
140
|
+
(0, decorators_1.RequirePermission)(auth_manifest_1.AUTH_PERMISSIONS.ACCOUNT_DELETE),
|
|
88
141
|
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
89
142
|
(0, swagger_1.ApiOperation)({
|
|
90
143
|
summary: 'Request account deletion (step 1)',
|
|
91
|
-
description: '
|
|
144
|
+
description: 'Phone users: sends an OTP. Email users: prompts for password. OAuth users: prompts for ID token.',
|
|
92
145
|
}),
|
|
93
146
|
(0, swagger_1.ApiOkResponse)({
|
|
94
147
|
schema: {
|
|
@@ -106,10 +159,15 @@ __decorate([
|
|
|
106
159
|
], AccountController.prototype, "requestDeletion", null);
|
|
107
160
|
__decorate([
|
|
108
161
|
(0, common_1.Post)('account/delete-confirm'),
|
|
162
|
+
(0, decorators_1.RequirePermission)(auth_manifest_1.AUTH_PERMISSIONS.ACCOUNT_DELETE),
|
|
109
163
|
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
110
164
|
(0, swagger_1.ApiOperation)({
|
|
111
165
|
summary: 'Confirm account deletion (step 2)',
|
|
112
|
-
description: '
|
|
166
|
+
description: 'Exactly one confirmation shape:\n' +
|
|
167
|
+
'- Phone: `{ verificationId, otp }`\n' +
|
|
168
|
+
'- Email: `{ password }`\n' +
|
|
169
|
+
'- OAuth: `{ provider, idToken }`\n' +
|
|
170
|
+
'When MFA is enrolled, also pass `stepUpToken` from POST /auth/mfa/step-up with purpose=`account_delete`.',
|
|
113
171
|
}),
|
|
114
172
|
(0, swagger_1.ApiBody)({ type: password_dto_1.DeleteAccountConfirmDto }),
|
|
115
173
|
(0, swagger_1.ApiOkResponse)({ schema: { example: { message: 'Your account has been deleted.' } } }),
|
|
@@ -123,7 +181,7 @@ __decorate([
|
|
|
123
181
|
exports.AccountController = AccountController = __decorate([
|
|
124
182
|
(0, swagger_1.ApiTags)('Account'),
|
|
125
183
|
(0, common_1.Controller)('auth'),
|
|
126
|
-
(0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard),
|
|
184
|
+
(0, common_1.UseGuards)(auth_guard_1.JwtAuthGuard, permissions_guard_1.PermissionsGuard),
|
|
127
185
|
(0, swagger_1.ApiBearerAuth)(),
|
|
128
186
|
__metadata("design:paramtypes", [account_service_1.AccountService,
|
|
129
187
|
password_service_1.PasswordService])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/account.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAyF;AACzF,6CASyB;AAEzB,
|
|
1
|
+
{"version":3,"file":"account.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/account.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAyF;AACzF,6CASyB;AAEzB,2DAA4E;AAC5E,kEAAiE;AACjE,gFAA4E;AAE5E,qGAA+F;AAC/F,oDAAoD;AACpD,sDAM6B;AAC7B,iEAA6D;AAC7D,mEAA+D;AAMxD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEX;IACA;IAFlB,YACkB,cAA8B,EAC9B,eAAgC;QADhC,mBAAc,GAAd,cAAc,CAAgB;QAC9B,oBAAe,GAAf,eAAe,CAAiB;IAC/C,CAAC;IAEJ,6EAA6E;IAkB7E,WAAW,CAAgB,IAAiB,EAAU,IAAoB;QACzE,OAAO,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACzE,CAAC;IAaD,WAAW,CACK,IAAiB,EACC,IAAoB;QAErD,OAAO,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;IAED,6EAA6E;IAmB7E,cAAc,CACE,IAAiB,EACC,IAAuB;QAExD,OAAO,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC3D,CAAC;IAgBD,WAAW,CACK,IAAiB,EACC,I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C;IACD,IAAA,iBAAO,EAAC,EAAE,IAAI,EAAE,sCAAuB,EAAE,CAAC;IAC1C,IAAA,uBAAa,EAAC,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,gCAAgC,EAAE,EAAE,EAAE,CAAC;IACrF,IAAA,+BAAqB,EAAC,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;IAEtF,WAAA,IAAA,wBAAW,GAAE,CAAA;IACb,WAAA,IAAA,aAAI,EAAC,wDAAyB,CAAC,CAAA;;6CAAM,sCAAuB;;wDAG7D;4BAxIW,iBAAiB;IAJ7B,IAAA,iBAAO,EAAC,SAAS,CAAC;IAClB,IAAA,mBAAU,EAAC,MAAM,CAAC;IAClB,IAAA,kBAAS,EAAC,yBAAY,EAAE,oCAAgB,CAAC;IACzC,IAAA,uBAAa,GAAE;qCAGmB,gCAAc;QACb,kCAAe;GAHtC,iBAAiB,CAyI7B"}
|
|
@@ -4,18 +4,22 @@ import { AuthConfigResponseDto } from '../dto/auth-config.dto';
|
|
|
4
4
|
import { LoginDto } from '../dto/login.dto';
|
|
5
5
|
import { RegisterDto } from '../dto/register.dto';
|
|
6
6
|
import { TestLoginDto } from '../dto/test-login.dto';
|
|
7
|
+
import { DpopService } from '../services/dpop.service';
|
|
7
8
|
import { LoginService } from '../services/login.service';
|
|
8
9
|
import { OtpAuthService } from '../services/otp-auth.service';
|
|
9
10
|
import { RegistrationService } from '../services/registration.service';
|
|
11
|
+
import { TurnstileService } from '../services/turnstile.service';
|
|
10
12
|
export declare class AuthController {
|
|
11
13
|
private readonly loginService;
|
|
12
14
|
private readonly registrationService;
|
|
13
15
|
private readonly settingsService;
|
|
14
16
|
private readonly otpAuthService;
|
|
15
|
-
|
|
17
|
+
private readonly turnstileService;
|
|
18
|
+
private readonly dpopService;
|
|
19
|
+
constructor(loginService: LoginService, registrationService: RegistrationService, settingsService: SettingsService, otpAuthService: OtpAuthService, turnstileService: TurnstileService, dpopService: DpopService);
|
|
16
20
|
getConfig(): AuthConfigResponseDto;
|
|
17
|
-
login(body: LoginDto, req: Request): Promise<import("../dto/token.dto").
|
|
18
|
-
testLogin(body: TestLoginDto, req: Request): Promise<import("../dto/token.dto").
|
|
21
|
+
login(body: LoginDto, req: Request): Promise<import("../dto/token.dto").LoginResult>;
|
|
22
|
+
testLogin(body: TestLoginDto, req: Request): Promise<import("../dto/token.dto").LoginResult>;
|
|
19
23
|
register(body: RegisterDto, req: Request): Promise<import("../dto/token.dto").TokenResponse>;
|
|
20
24
|
}
|
|
21
25
|
//# sourceMappingURL=auth.controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/auth.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/auth.controller.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAQlC,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAA2B,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE9E,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAOjE,qBAIa,cAAc;IAEzB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW;gBALX,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE,mBAAmB,EACxC,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,WAAW;IAe1C,SAAS,IAAI,qBAAqB;IA2F5B,KAAK,CAAkC,IAAI,EAAE,QAAQ,EAAS,GAAG,EAAE,OAAO;IAmC1E,SAAS,CAAkC,IAAI,EAAE,YAAY,EAAS,GAAG,EAAE,OAAO;IAuElF,QAAQ,CAAkC,IAAI,EAAE,WAAW,EAAS,GAAG,EAAE,OAAO;CAMtF"}
|
|
@@ -16,6 +16,7 @@ exports.AuthController = void 0;
|
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const swagger_1 = require("@nestjs/swagger");
|
|
18
18
|
const decorators_1 = require("../../../common/decorators");
|
|
19
|
+
const ip_rate_limit_bucket_decorator_1 = require("../../../common/decorators/ip-rate-limit-bucket.decorator");
|
|
19
20
|
const guards_1 = require("../../../common/guards");
|
|
20
21
|
const config_aware_validation_pipe_1 = require("../../../common/pipes/config-aware-validation.pipe");
|
|
21
22
|
const request_utils_1 = require("../../../common/utils/request.utils");
|
|
@@ -23,52 +24,80 @@ const settings_keys_1 = require("../../settings/constants/settings.keys");
|
|
|
23
24
|
const settings_service_1 = require("../../settings/services/settings.service");
|
|
24
25
|
const auth_config_dto_1 = require("../dto/auth-config.dto");
|
|
25
26
|
const login_dto_1 = require("../dto/login.dto");
|
|
27
|
+
const mfa_dto_1 = require("../dto/mfa.dto");
|
|
26
28
|
const register_dto_1 = require("../dto/register.dto");
|
|
27
29
|
const test_login_dto_1 = require("../dto/test-login.dto");
|
|
28
30
|
const token_dto_1 = require("../dto/token.dto");
|
|
31
|
+
const dpop_service_1 = require("../services/dpop.service");
|
|
29
32
|
const login_service_1 = require("../services/login.service");
|
|
30
33
|
const otp_auth_service_1 = require("../services/otp-auth.service");
|
|
31
34
|
const registration_service_1 = require("../services/registration.service");
|
|
35
|
+
const turnstile_service_1 = require("../services/turnstile.service");
|
|
32
36
|
const auth_supported_util_1 = require("../utils/auth-supported.util");
|
|
33
37
|
let AuthController = class AuthController {
|
|
34
38
|
loginService;
|
|
35
39
|
registrationService;
|
|
36
40
|
settingsService;
|
|
37
41
|
otpAuthService;
|
|
38
|
-
|
|
42
|
+
turnstileService;
|
|
43
|
+
dpopService;
|
|
44
|
+
constructor(loginService, registrationService, settingsService, otpAuthService, turnstileService, dpopService) {
|
|
39
45
|
this.loginService = loginService;
|
|
40
46
|
this.registrationService = registrationService;
|
|
41
47
|
this.settingsService = settingsService;
|
|
42
48
|
this.otpAuthService = otpAuthService;
|
|
49
|
+
this.turnstileService = turnstileService;
|
|
50
|
+
this.dpopService = dpopService;
|
|
43
51
|
}
|
|
44
52
|
getConfig() {
|
|
45
53
|
const defaultAuthMethod = this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_METHOD);
|
|
46
54
|
const supportedLoginMethods = (0, auth_supported_util_1.parseSupportedAuthMethods)(this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_SUPPORTED_LOGIN_METHODS));
|
|
47
55
|
const supportedRegistrationMethods = (0, auth_supported_util_1.parseSupportedAuthMethods)(this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_SUPPORTED_REGISTRATION_METHODS));
|
|
56
|
+
const mfaRequiredForMethods = (0, auth_supported_util_1.parseMfaRequiredMethods)(this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_MFA_REQUIRED_FOR_METHODS));
|
|
57
|
+
const emailLogin = supportedLoginMethods.includes('email');
|
|
58
|
+
const phoneLogin = supportedLoginMethods.includes('phone');
|
|
48
59
|
return {
|
|
49
60
|
defaultAuthMethod,
|
|
50
61
|
supportedLoginMethods,
|
|
51
62
|
supportedRegistrationMethods,
|
|
52
|
-
passwordResetEnabled:
|
|
63
|
+
passwordResetEnabled: emailLogin || phoneLogin,
|
|
64
|
+
emailPasswordResetEnabled: emailLogin,
|
|
65
|
+
phonePasswordResetEnabled: phoneLogin,
|
|
66
|
+
requireEmailVerifiedToLogin: this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_EMAIL_REQUIRE_VERIFIED_TO_LOGIN) ?? false,
|
|
67
|
+
mfaEnabled: this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_MFA_ENABLED) ?? true,
|
|
68
|
+
mfaRequiredForMethods,
|
|
69
|
+
oauthProviders: (0, auth_supported_util_1.parseOAuthProviders)(this.settingsService.get(settings_keys_1.SETTING_KEYS.AUTH_OAUTH_PROVIDERS)),
|
|
70
|
+
turnstileEnabled: this.turnstileService.isEnabled(),
|
|
71
|
+
turnstileSiteKey: this.turnstileService.isEnabled()
|
|
72
|
+
? this.turnstileService.siteKey() || undefined
|
|
73
|
+
: undefined,
|
|
74
|
+
dpopMode: this.dpopService.mode(),
|
|
53
75
|
};
|
|
54
76
|
}
|
|
55
|
-
login(body, req) {
|
|
77
|
+
async login(body, req) {
|
|
56
78
|
const { ip, deviceInfo } = (0, request_utils_1.extractRequestInfo)(req);
|
|
57
|
-
|
|
79
|
+
await this.turnstileService.assertValid(body.turnstileToken, ip);
|
|
80
|
+
const dpopJkt = await this.dpopService.resolveJktForIssuance(req);
|
|
81
|
+
return this.loginService.login(body, deviceInfo, ip, dpopJkt);
|
|
58
82
|
}
|
|
59
|
-
testLogin(body, req) {
|
|
83
|
+
async testLogin(body, req) {
|
|
60
84
|
const { identifier, channel } = (0, test_login_dto_1.resolveTestLoginChannel)(body);
|
|
61
85
|
const { ip, deviceInfo } = (0, request_utils_1.extractRequestInfo)(req);
|
|
62
|
-
|
|
86
|
+
const dpopJkt = await this.dpopService.resolveJktForIssuance(req);
|
|
87
|
+
return this.otpAuthService.testLogin(identifier, channel, body.otp, deviceInfo, ip, dpopJkt);
|
|
63
88
|
}
|
|
64
|
-
register(body, req) {
|
|
89
|
+
async register(body, req) {
|
|
65
90
|
const { ip, deviceInfo } = (0, request_utils_1.extractRequestInfo)(req);
|
|
66
|
-
|
|
91
|
+
await this.turnstileService.assertValid(body.turnstileToken, ip);
|
|
92
|
+
const dpopJkt = await this.dpopService.resolveJktForIssuance(req);
|
|
93
|
+
return this.registrationService.register(body, deviceInfo, ip, dpopJkt);
|
|
67
94
|
}
|
|
68
95
|
};
|
|
69
96
|
exports.AuthController = AuthController;
|
|
70
97
|
__decorate([
|
|
71
98
|
(0, common_1.Get)('config'),
|
|
99
|
+
(0, ip_rate_limit_bucket_decorator_1.IpRateLimitBucket)('auth_public'),
|
|
100
|
+
(0, common_1.UseGuards)(guards_1.LoginIpRateLimitGuard),
|
|
72
101
|
(0, swagger_1.ApiOperation)({
|
|
73
102
|
summary: 'Auth configuration',
|
|
74
103
|
description: 'Returns defaults and supported credential shapes. ' +
|
|
@@ -76,6 +105,7 @@ __decorate([
|
|
|
76
105
|
'After auth, use `user.authMethod` from the token response for returning users.',
|
|
77
106
|
}),
|
|
78
107
|
(0, swagger_1.ApiOkResponse)({ type: auth_config_dto_1.AuthConfigResponseDto }),
|
|
108
|
+
(0, swagger_1.ApiTooManyRequestsResponse)({ description: 'IP rate limit exceeded' }),
|
|
79
109
|
__metadata("design:type", Function),
|
|
80
110
|
__metadata("design:paramtypes", []),
|
|
81
111
|
__metadata("design:returntype", auth_config_dto_1.AuthConfigResponseDto)
|
|
@@ -88,8 +118,12 @@ __decorate([
|
|
|
88
118
|
summary: 'Login',
|
|
89
119
|
description: 'Send **one** credential shape — routing is based on the body, not the global auth.method setting:\n\n' +
|
|
90
120
|
'- `{ verificationToken }` — phone OTP login (after verify-otp when hasAccount=true)\n' +
|
|
91
|
-
'- `{ email, password }` — email/password login\n
|
|
92
|
-
|
|
121
|
+
'- `{ email, password }` — email/password login\n' +
|
|
122
|
+
'- `{ provider, idToken }` — OAuth (e.g. Google) login\n\n' +
|
|
123
|
+
"The user's stored `authMethod` must match the chosen shape (401 otherwise), " +
|
|
124
|
+
'except linked OAuth identities on email/phone accounts.\n\n' +
|
|
125
|
+
'If MFA is enabled for the user, the response is ' +
|
|
126
|
+
'`{ mfaRequired: true, mfaToken, methods, expiresIn }` — complete with POST /auth/mfa/verify.',
|
|
93
127
|
}),
|
|
94
128
|
(0, swagger_1.ApiBody)({
|
|
95
129
|
type: login_dto_1.LoginDto,
|
|
@@ -102,14 +136,26 @@ __decorate([
|
|
|
102
136
|
summary: 'Email + password login',
|
|
103
137
|
value: { email: 'user@example.com', password: 'P@ssw0rd!' },
|
|
104
138
|
},
|
|
139
|
+
oauth: {
|
|
140
|
+
summary: 'Google OAuth login',
|
|
141
|
+
value: { provider: 'google', idToken: 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...' },
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
}),
|
|
145
|
+
(0, swagger_1.ApiOkResponse)({
|
|
146
|
+
description: 'Session tokens, or MFA challenge when mfaRequired is true',
|
|
147
|
+
schema: {
|
|
148
|
+
oneOf: [
|
|
149
|
+
{ $ref: '#/components/schemas/TokenResponseDto' },
|
|
150
|
+
{ $ref: '#/components/schemas/MfaChallengeResponseDto' },
|
|
151
|
+
],
|
|
105
152
|
},
|
|
106
153
|
}),
|
|
107
|
-
(0, swagger_1.ApiOkResponse)({ type: token_dto_1.TokenResponseDto }),
|
|
108
154
|
(0, swagger_1.ApiBadRequestResponse)({
|
|
109
155
|
description: 'Ambiguous or missing login credentials (must send exactly one shape)',
|
|
110
156
|
}),
|
|
111
157
|
(0, swagger_1.ApiUnauthorizedResponse)({
|
|
112
|
-
description: 'Invalid
|
|
158
|
+
description: 'Invalid credentials / token',
|
|
113
159
|
}),
|
|
114
160
|
(0, swagger_1.ApiForbiddenResponse)({
|
|
115
161
|
description: 'Selected login method is disabled via auth.supported_login_methods',
|
|
@@ -121,7 +167,7 @@ __decorate([
|
|
|
121
167
|
__param(1, (0, common_1.Req)()),
|
|
122
168
|
__metadata("design:type", Function),
|
|
123
169
|
__metadata("design:paramtypes", [login_dto_1.LoginDto, Object]),
|
|
124
|
-
__metadata("design:returntype",
|
|
170
|
+
__metadata("design:returntype", Promise)
|
|
125
171
|
], AuthController.prototype, "login", null);
|
|
126
172
|
__decorate([
|
|
127
173
|
(0, common_1.Post)('test-login'),
|
|
@@ -155,16 +201,19 @@ __decorate([
|
|
|
155
201
|
__param(1, (0, common_1.Req)()),
|
|
156
202
|
__metadata("design:type", Function),
|
|
157
203
|
__metadata("design:paramtypes", [test_login_dto_1.TestLoginDto, Object]),
|
|
158
|
-
__metadata("design:returntype",
|
|
204
|
+
__metadata("design:returntype", Promise)
|
|
159
205
|
], AuthController.prototype, "testLogin", null);
|
|
160
206
|
__decorate([
|
|
161
207
|
(0, common_1.Post)('register'),
|
|
208
|
+
(0, ip_rate_limit_bucket_decorator_1.IpRateLimitBucket)('auth_public'),
|
|
209
|
+
(0, common_1.UseGuards)(guards_1.LoginIpRateLimitGuard),
|
|
162
210
|
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
163
211
|
(0, swagger_1.ApiOperation)({
|
|
164
212
|
summary: 'Register new account',
|
|
165
213
|
description: 'Send **one** registration shape — routing is based on the body:\n\n' +
|
|
166
214
|
'**Phone:** `{ verificationToken, profile }` after verify-otp (hasAccount=false)\n\n' +
|
|
167
215
|
'**Email:** `{ email, password, profile }`\n\n' +
|
|
216
|
+
'**OAuth:** `{ provider, idToken, profile }`\n\n' +
|
|
168
217
|
'Use **verificationToken** from verify-otp — not verificationId.',
|
|
169
218
|
}),
|
|
170
219
|
(0, swagger_1.ApiBody)({
|
|
@@ -185,6 +234,14 @@ __decorate([
|
|
|
185
234
|
profile: { firstName: 'Ada', lastName: 'Lovelace' },
|
|
186
235
|
},
|
|
187
236
|
},
|
|
237
|
+
oauth: {
|
|
238
|
+
summary: 'Google OAuth signup',
|
|
239
|
+
value: {
|
|
240
|
+
provider: 'google',
|
|
241
|
+
idToken: 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...',
|
|
242
|
+
profile: { firstName: 'Ada', lastName: 'Lovelace' },
|
|
243
|
+
},
|
|
244
|
+
},
|
|
188
245
|
},
|
|
189
246
|
}),
|
|
190
247
|
(0, swagger_1.ApiCreatedResponse)({ type: token_dto_1.TokenResponseDto }),
|
|
@@ -204,15 +261,18 @@ __decorate([
|
|
|
204
261
|
__param(1, (0, common_1.Req)()),
|
|
205
262
|
__metadata("design:type", Function),
|
|
206
263
|
__metadata("design:paramtypes", [register_dto_1.RegisterDto, Object]),
|
|
207
|
-
__metadata("design:returntype",
|
|
264
|
+
__metadata("design:returntype", Promise)
|
|
208
265
|
], AuthController.prototype, "register", null);
|
|
209
266
|
exports.AuthController = AuthController = __decorate([
|
|
210
267
|
(0, swagger_1.ApiTags)('Auth'),
|
|
268
|
+
(0, swagger_1.ApiExtraModels)(token_dto_1.TokenResponseDto, mfa_dto_1.MfaChallengeResponseDto),
|
|
211
269
|
(0, common_1.Controller)('auth'),
|
|
212
270
|
(0, decorators_1.Public)(),
|
|
213
271
|
__metadata("design:paramtypes", [login_service_1.LoginService,
|
|
214
272
|
registration_service_1.RegistrationService,
|
|
215
273
|
settings_service_1.SettingsService,
|
|
216
|
-
otp_auth_service_1.OtpAuthService
|
|
274
|
+
otp_auth_service_1.OtpAuthService,
|
|
275
|
+
turnstile_service_1.TurnstileService,
|
|
276
|
+
dpop_service_1.DpopService])
|
|
217
277
|
], AuthController);
|
|
218
278
|
//# sourceMappingURL=auth.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmG;AACnG,
|
|
1
|
+
{"version":3,"file":"auth.controller.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H;KACnH,CAAC;IACD,IAAA,iCAAuB,EAAC;QACxB,WAAW,EACV,oIAAoI;KACrI,CAAC;IACD,IAAA,8BAAoB,EAAC;QACrB,WAAW,EACV,kFAAkF;KACnF,CAAC;IACc,WAAA,IAAA,aAAI,EAAC,wDAAyB,CAAC,CAAA;IAAqB,WAAA,IAAA,YAAG,GAAE,CAAA;;qCAAnB,0BAAW;;8CAKhE;yBAhOW,cAAc;IAJ1B,IAAA,iBAAO,EAAC,MAAM,CAAC;IACf,IAAA,wBAAc,EAAC,4BAAgB,EAAE,iCAAuB,CAAC;IACzD,IAAA,mBAAU,EAAC,MAAM,CAAC;IAClB,IAAA,mBAAM,GAAE;qCAGwB,4BAAY;QACL,0CAAmB;QACvB,kCAAe;QAChB,iCAAc;QACZ,oCAAgB;QACrB,0BAAW;GAP9B,cAAc,CAiO1B"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Request } from 'express';
|
|
2
2
|
import { ForgotPasswordDto, ResetPasswordDto, ResetPasswordWithPhoneDto } from '../dto/password.dto';
|
|
3
3
|
import { PasswordService } from '../services/password.service';
|
|
4
|
+
import { TurnstileService } from '../services/turnstile.service';
|
|
4
5
|
export declare class ForgotPasswordController {
|
|
5
6
|
private readonly passwordService;
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
private readonly turnstileService;
|
|
8
|
+
constructor(passwordService: PasswordService, turnstileService: TurnstileService);
|
|
9
|
+
forgotPassword(body: ForgotPasswordDto, req: Request): Promise<{
|
|
8
10
|
message: string;
|
|
9
11
|
}>;
|
|
10
12
|
resetPassword(body: ResetPasswordDto, req: Request): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgot-password.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/forgot-password.controller.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"forgot-password.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/forgot-password.controller.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAMlC,OAAO,EACN,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,qBAGa,wBAAwB;IAEnC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBADhB,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB;IAmB9C,cAAc,CAAS,IAAI,EAAE,iBAAiB,EAAS,GAAG,EAAE,OAAO;;;IAiBzE,aAAa,CAAS,IAAI,EAAE,gBAAgB,EAAS,GAAG,EAAE,OAAO;;;IAwBjE,sBAAsB,CAAS,IAAI,EAAE,yBAAyB,EAAS,GAAG,EAAE,OAAO;;;CAInF"}
|
|
@@ -16,16 +16,23 @@ exports.ForgotPasswordController = void 0;
|
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const swagger_1 = require("@nestjs/swagger");
|
|
18
18
|
const decorators_1 = require("../../../common/decorators");
|
|
19
|
+
const ip_rate_limit_bucket_decorator_1 = require("../../../common/decorators/ip-rate-limit-bucket.decorator");
|
|
20
|
+
const guards_1 = require("../../../common/guards");
|
|
19
21
|
const request_utils_1 = require("../../../common/utils/request.utils");
|
|
20
22
|
const password_dto_1 = require("../dto/password.dto");
|
|
21
23
|
const password_service_1 = require("../services/password.service");
|
|
24
|
+
const turnstile_service_1 = require("../services/turnstile.service");
|
|
22
25
|
let ForgotPasswordController = class ForgotPasswordController {
|
|
23
26
|
passwordService;
|
|
24
|
-
|
|
27
|
+
turnstileService;
|
|
28
|
+
constructor(passwordService, turnstileService) {
|
|
25
29
|
this.passwordService = passwordService;
|
|
30
|
+
this.turnstileService = turnstileService;
|
|
26
31
|
}
|
|
27
|
-
forgotPassword(body) {
|
|
28
|
-
|
|
32
|
+
async forgotPassword(body, req) {
|
|
33
|
+
const { ip } = (0, request_utils_1.extractRequestInfo)(req);
|
|
34
|
+
await this.turnstileService.assertValid(body.turnstileToken, ip);
|
|
35
|
+
return this.passwordService.forgotPassword(body, ip);
|
|
29
36
|
}
|
|
30
37
|
resetPassword(body, req) {
|
|
31
38
|
const { ip } = (0, request_utils_1.extractRequestInfo)(req);
|
|
@@ -39,10 +46,13 @@ let ForgotPasswordController = class ForgotPasswordController {
|
|
|
39
46
|
exports.ForgotPasswordController = ForgotPasswordController;
|
|
40
47
|
__decorate([
|
|
41
48
|
(0, common_1.Post)('forgot-password'),
|
|
49
|
+
(0, ip_rate_limit_bucket_decorator_1.IpRateLimitBucket)('auth_public'),
|
|
50
|
+
(0, common_1.UseGuards)(guards_1.LoginIpRateLimitGuard),
|
|
42
51
|
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
43
52
|
(0, swagger_1.ApiOperation)({
|
|
44
53
|
summary: 'Forgot password (email)',
|
|
45
|
-
description: 'Sends a password reset link to the registered email. Always returns success to prevent user enumeration.'
|
|
54
|
+
description: 'Sends a password reset link to the registered email. Always returns success to prevent user enumeration. ' +
|
|
55
|
+
'When Turnstile is enabled, pass `turnstileToken`.',
|
|
46
56
|
}),
|
|
47
57
|
(0, swagger_1.ApiBody)({ type: password_dto_1.ForgotPasswordDto }),
|
|
48
58
|
(0, swagger_1.ApiOkResponse)({
|
|
@@ -51,12 +61,15 @@ __decorate([
|
|
|
51
61
|
},
|
|
52
62
|
}),
|
|
53
63
|
__param(0, (0, common_1.Body)()),
|
|
64
|
+
__param(1, (0, common_1.Req)()),
|
|
54
65
|
__metadata("design:type", Function),
|
|
55
|
-
__metadata("design:paramtypes", [password_dto_1.ForgotPasswordDto]),
|
|
56
|
-
__metadata("design:returntype",
|
|
66
|
+
__metadata("design:paramtypes", [password_dto_1.ForgotPasswordDto, Object]),
|
|
67
|
+
__metadata("design:returntype", Promise)
|
|
57
68
|
], ForgotPasswordController.prototype, "forgotPassword", null);
|
|
58
69
|
__decorate([
|
|
59
70
|
(0, common_1.Post)('reset-password'),
|
|
71
|
+
(0, ip_rate_limit_bucket_decorator_1.IpRateLimitBucket)('auth_public'),
|
|
72
|
+
(0, common_1.UseGuards)(guards_1.LoginIpRateLimitGuard),
|
|
60
73
|
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
61
74
|
(0, swagger_1.ApiOperation)({
|
|
62
75
|
summary: 'Reset password (email token)',
|
|
@@ -73,15 +86,22 @@ __decorate([
|
|
|
73
86
|
], ForgotPasswordController.prototype, "resetPassword", null);
|
|
74
87
|
__decorate([
|
|
75
88
|
(0, common_1.Post)('reset-password/phone'),
|
|
89
|
+
(0, ip_rate_limit_bucket_decorator_1.IpRateLimitBucket)('auth_public'),
|
|
90
|
+
(0, common_1.UseGuards)(guards_1.LoginIpRateLimitGuard),
|
|
76
91
|
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
77
92
|
(0, swagger_1.ApiOperation)({
|
|
78
|
-
summary: 'Reset password (phone OTP)',
|
|
79
|
-
description: '
|
|
93
|
+
summary: 'Reset / set password (phone OTP)',
|
|
94
|
+
description: 'Use the login bridge `verificationToken` from POST /auth/verify-otp when hasAccount=true. ' +
|
|
95
|
+
'Sets a password and revokes all sessions. Password becomes an additional login factor (authMethod unchanged).',
|
|
80
96
|
}),
|
|
81
97
|
(0, swagger_1.ApiBody)({ type: password_dto_1.ResetPasswordWithPhoneDto }),
|
|
82
|
-
(0, swagger_1.ApiOkResponse)({
|
|
98
|
+
(0, swagger_1.ApiOkResponse)({
|
|
99
|
+
schema: {
|
|
100
|
+
example: { message: 'Password reset successfully. All sessions have been revoked.' },
|
|
101
|
+
},
|
|
102
|
+
}),
|
|
83
103
|
(0, swagger_1.ApiUnauthorizedResponse)({
|
|
84
|
-
description: 'Invalid or expired verificationToken
|
|
104
|
+
description: 'Invalid or expired verificationToken (must be hasAccount=true login bridge)',
|
|
85
105
|
}),
|
|
86
106
|
__param(0, (0, common_1.Body)()),
|
|
87
107
|
__param(1, (0, common_1.Req)()),
|
|
@@ -93,6 +113,7 @@ exports.ForgotPasswordController = ForgotPasswordController = __decorate([
|
|
|
93
113
|
(0, swagger_1.ApiTags)('Auth'),
|
|
94
114
|
(0, common_1.Controller)('auth'),
|
|
95
115
|
(0, decorators_1.Public)(),
|
|
96
|
-
__metadata("design:paramtypes", [password_service_1.PasswordService
|
|
116
|
+
__metadata("design:paramtypes", [password_service_1.PasswordService,
|
|
117
|
+
turnstile_service_1.TurnstileService])
|
|
97
118
|
], ForgotPasswordController);
|
|
98
119
|
//# sourceMappingURL=forgot-password.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgot-password.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/forgot-password.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"forgot-password.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/forgot-password.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA8F;AAC9F,6CAMyB;AAGzB,2DAAoD;AACpD,8GAA8F;AAC9F,mDAA+D;AAC/D,uEAAyE;AACzE,sDAI6B;AAC7B,mEAA+D;AAC/D,qEAAiE;AAK1D,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAElB;IACA;IAFlB,YACkB,eAAgC,EAChC,gBAAkC;QADlC,oBAAe,GAAf,eAAe,CAAiB;QAChC,qBAAgB,GAAhB,gBAAgB,CAAkB;IACjD,CAAC;IAkBE,AAAN,KAAK,CAAC,cAAc,CAAS,IAAuB,EAAS,GAAY;QACxE,MAAM,EAAE,EAAE,EAAE,GAAG,IAAA,kCAAkB,EAAC,GAAG,CAAC,CAAC;QACvC,MAAM,IAAI,CAAC,gBAAgB,CAAC,WAAW,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