@ambushsoftworks/nestjs-auth-graphql 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +320 -0
- package/dist/auth.module.d.ts +4 -1
- package/dist/auth.module.d.ts.map +1 -1
- package/dist/auth.module.js +10 -1
- package/dist/auth.module.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/magic-link-repository.interface.d.ts +6 -0
- package/dist/interfaces/magic-link-repository.interface.d.ts.map +1 -0
- package/dist/interfaces/magic-link-repository.interface.js +3 -0
- package/dist/interfaces/magic-link-repository.interface.js.map +1 -0
- package/dist/interfaces/password-policy-config.interface.d.ts +16 -0
- package/dist/interfaces/password-policy-config.interface.d.ts.map +1 -0
- package/dist/interfaces/password-policy-config.interface.js +3 -0
- package/dist/interfaces/password-policy-config.interface.js.map +1 -0
- package/dist/interfaces/password-reset-strategy.interface.d.ts +7 -0
- package/dist/interfaces/password-reset-strategy.interface.d.ts.map +1 -0
- package/dist/interfaces/password-reset-strategy.interface.js +3 -0
- package/dist/interfaces/password-reset-strategy.interface.js.map +1 -0
- package/dist/interfaces/rate-limiter.interface.d.ts +9 -0
- package/dist/interfaces/rate-limiter.interface.d.ts.map +1 -0
- package/dist/interfaces/rate-limiter.interface.js +3 -0
- package/dist/interfaces/rate-limiter.interface.js.map +1 -0
- package/dist/repositories/noop-magic-link.repository.d.ts +9 -0
- package/dist/repositories/noop-magic-link.repository.d.ts.map +1 -0
- package/dist/repositories/noop-magic-link.repository.js +37 -0
- package/dist/repositories/noop-magic-link.repository.js.map +1 -0
- package/dist/repositories/noop-rate-limiter.d.ts +12 -0
- package/dist/repositories/noop-rate-limiter.d.ts.map +1 -0
- package/dist/repositories/noop-rate-limiter.js +38 -0
- package/dist/repositories/noop-rate-limiter.js.map +1 -0
- package/dist/services/auth.service.d.ts +4 -2
- package/dist/services/auth.service.d.ts.map +1 -1
- package/dist/services/auth.service.js +19 -22
- package/dist/services/auth.service.js.map +1 -1
- package/dist/services/in-memory-rate-limiter.service.d.ts +15 -0
- package/dist/services/in-memory-rate-limiter.service.d.ts.map +1 -0
- package/dist/services/in-memory-rate-limiter.service.js +75 -0
- package/dist/services/in-memory-rate-limiter.service.js.map +1 -0
- package/dist/services/password-validation.service.d.ts +11 -0
- package/dist/services/password-validation.service.d.ts.map +1 -0
- package/dist/services/password-validation.service.js +75 -0
- package/dist/services/password-validation.service.js.map +1 -0
- package/dist/services/sendgrid-email.service.d.ts +1 -1
- package/dist/services/sendgrid-email.service.d.ts.map +1 -1
- package/dist/services/sendgrid-email.service.js +90 -107
- package/dist/services/sendgrid-email.service.js.map +1 -1
- package/dist/strategies/magic-link.strategy.d.ts +16 -0
- package/dist/strategies/magic-link.strategy.d.ts.map +1 -0
- package/dist/strategies/magic-link.strategy.js +80 -0
- package/dist/strategies/magic-link.strategy.js.map +1 -0
- package/dist/strategies/verification-code.strategy.d.ts +11 -0
- package/dist/strategies/verification-code.strategy.d.ts.map +1 -0
- package/dist/strategies/verification-code.strategy.js +44 -0
- package/dist/strategies/verification-code.strategy.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@ Production-grade authentication package for NestJS with GraphQL, extracted from
|
|
|
25
25
|
- **OAuth 2.0**: Google and Facebook social login
|
|
26
26
|
- **Email Verification**: 6-digit PIN codes via SendGrid with rate limiting
|
|
27
27
|
- **SMS Verification**: Phone number verification via Twilio
|
|
28
|
+
- **Password Reset**: 6-digit verification codes with email enumeration protection
|
|
28
29
|
- **Biometric Authentication**: Face ID, Touch ID, fingerprint support
|
|
29
30
|
- **Brute Force Protection**: Account lockout after failed login attempts
|
|
30
31
|
- **Account Linking**: Link/unlink social accounts to existing accounts
|
|
@@ -457,6 +458,308 @@ import { NoOpEmailService, NoOpSmsService } from '@yourorg/nestjs-auth-graphql';
|
|
|
457
458
|
})
|
|
458
459
|
```
|
|
459
460
|
|
|
461
|
+
## Password Reset
|
|
462
|
+
|
|
463
|
+
Secure password reset flow with 6-digit verification codes, rate limiting, and email enumeration protection.
|
|
464
|
+
|
|
465
|
+
### Features
|
|
466
|
+
|
|
467
|
+
- **6-Digit Verification Codes** - SMS/email verification pattern (not magic links)
|
|
468
|
+
- **Email Enumeration Protection** - Generic success messages for all requests
|
|
469
|
+
- **Rate Limiting** - 60-second cooldown between requests per user
|
|
470
|
+
- **Password Strength Validation** - Configurable requirements (default: 8+ chars, uppercase, lowercase, number)
|
|
471
|
+
- **Token Revocation** - All refresh tokens invalidated on password change
|
|
472
|
+
- **Brute Force Protection** - Integration with account locking system
|
|
473
|
+
- **OAuth User Protection** - Users authenticated via social login cannot reset passwords
|
|
474
|
+
- **Security Logging** - Audit trail for all password reset activities
|
|
475
|
+
|
|
476
|
+
### Consumer Setup
|
|
477
|
+
|
|
478
|
+
#### Step 1: Database Migration
|
|
479
|
+
|
|
480
|
+
Add `passwordResetSentAt` field to your User model:
|
|
481
|
+
|
|
482
|
+
**Prisma Example:**
|
|
483
|
+
```prisma
|
|
484
|
+
model User {
|
|
485
|
+
id String @id @default(cuid())
|
|
486
|
+
email String @unique
|
|
487
|
+
passwordHash String?
|
|
488
|
+
|
|
489
|
+
// Password reset rate limiting
|
|
490
|
+
passwordResetSentAt DateTime? // 60-second cooldown
|
|
491
|
+
|
|
492
|
+
// ... other fields
|
|
493
|
+
}
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
**TypeORM Example:**
|
|
497
|
+
```typescript
|
|
498
|
+
@Entity()
|
|
499
|
+
export class User {
|
|
500
|
+
@PrimaryGeneratedColumn('uuid')
|
|
501
|
+
id: string;
|
|
502
|
+
|
|
503
|
+
@Column({ nullable: true })
|
|
504
|
+
passwordResetSentAt: Date;
|
|
505
|
+
|
|
506
|
+
// ... other fields
|
|
507
|
+
}
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
#### Step 2: Configure Email Service
|
|
511
|
+
|
|
512
|
+
Ensure `SendGridEmailService` (or your custom email service) is configured:
|
|
513
|
+
|
|
514
|
+
```typescript
|
|
515
|
+
AuthModule.forRootAsync({
|
|
516
|
+
imports: [ConfigModule],
|
|
517
|
+
inject: [ConfigService, UsersRepository, /* ... */],
|
|
518
|
+
useFactory: (config: ConfigService, usersRepo, /* ... */) => ({
|
|
519
|
+
// ... other options
|
|
520
|
+
|
|
521
|
+
emailServiceInstance: new SendGridEmailService(
|
|
522
|
+
config.get('SENDGRID_API_KEY'),
|
|
523
|
+
),
|
|
524
|
+
|
|
525
|
+
// IMPORTANT: Set frontend URL for email templates
|
|
526
|
+
// (Not used in 6-digit code flow, but required by email service)
|
|
527
|
+
features: {
|
|
528
|
+
emailVerification: true,
|
|
529
|
+
// ... other features
|
|
530
|
+
},
|
|
531
|
+
}),
|
|
532
|
+
}),
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
**Environment Variable:**
|
|
536
|
+
```bash
|
|
537
|
+
FRONTEND_URL=https://yourapp.com # Used in email branding
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
#### Step 3: Create GraphQL DTOs
|
|
541
|
+
|
|
542
|
+
Create consumer-specific DTOs with GraphQL decorators:
|
|
543
|
+
|
|
544
|
+
**`request-password-reset.input.ts`:**
|
|
545
|
+
```typescript
|
|
546
|
+
import { InputType, Field } from '@nestjs/graphql';
|
|
547
|
+
import { IAuthRequestPasswordResetInput } from '@ambushsoftworks/nestjs-auth-graphql';
|
|
548
|
+
|
|
549
|
+
@InputType()
|
|
550
|
+
export class RequestPasswordResetInput implements IAuthRequestPasswordResetInput {
|
|
551
|
+
@Field(() => String, {
|
|
552
|
+
description: 'User email address. Code sent if account exists.',
|
|
553
|
+
})
|
|
554
|
+
email: string;
|
|
555
|
+
}
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
**`reset-password.input.ts`:**
|
|
559
|
+
```typescript
|
|
560
|
+
import { InputType, Field } from '@nestjs/graphql';
|
|
561
|
+
import { IAuthResetPasswordInput } from '@ambushsoftworks/nestjs-auth-graphql';
|
|
562
|
+
|
|
563
|
+
@InputType()
|
|
564
|
+
export class ResetPasswordInput implements IAuthResetPasswordInput {
|
|
565
|
+
@Field(() => String)
|
|
566
|
+
email: string;
|
|
567
|
+
|
|
568
|
+
@Field(() => String, { description: '6-digit verification code' })
|
|
569
|
+
code: string;
|
|
570
|
+
|
|
571
|
+
@Field(() => String, { description: 'New password (8+ chars, uppercase, lowercase, number)' })
|
|
572
|
+
newPassword: string;
|
|
573
|
+
}
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
**`password-reset-response.dto.ts`:**
|
|
577
|
+
```typescript
|
|
578
|
+
import { ObjectType, Field, Int } from '@nestjs/graphql';
|
|
579
|
+
import { IAuthPasswordResetResponse } from '@ambushsoftworks/nestjs-auth-graphql';
|
|
580
|
+
|
|
581
|
+
@ObjectType()
|
|
582
|
+
export class PasswordResetResponse implements IAuthPasswordResetResponse {
|
|
583
|
+
@Field(() => Boolean)
|
|
584
|
+
success: boolean;
|
|
585
|
+
|
|
586
|
+
@Field(() => String)
|
|
587
|
+
message: string;
|
|
588
|
+
|
|
589
|
+
@Field(() => Int, { nullable: true })
|
|
590
|
+
retryAfterSeconds?: number;
|
|
591
|
+
}
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
#### Step 4: Add Resolver Mutations
|
|
595
|
+
|
|
596
|
+
Extend your custom resolver with password reset mutations:
|
|
597
|
+
|
|
598
|
+
```typescript
|
|
599
|
+
import { Resolver, Mutation, Args, Context } from '@nestjs/graphql';
|
|
600
|
+
import { Throttle } from '@nestjs/throttler';
|
|
601
|
+
import { BaseAuthResolver } from '@ambushsoftworks/nestjs-auth-graphql';
|
|
602
|
+
import { RequestPasswordResetInput } from './dto/request-password-reset.input';
|
|
603
|
+
import { ResetPasswordInput } from './dto/reset-password.input';
|
|
604
|
+
import { PasswordResetResponse } from './dto/password-reset-response.dto';
|
|
605
|
+
import { User } from './entities/user.entity';
|
|
606
|
+
|
|
607
|
+
@Resolver()
|
|
608
|
+
export class AppAuthResolver extends BaseAuthResolver<User> {
|
|
609
|
+
// ... other mutations (signup, login, etc.)
|
|
610
|
+
|
|
611
|
+
@Mutation(() => PasswordResetResponse, {
|
|
612
|
+
name: 'requestPasswordReset',
|
|
613
|
+
description: 'Request password reset code via email',
|
|
614
|
+
})
|
|
615
|
+
@Throttle({ default: { limit: 3, ttl: 60000 } }) // 3 requests per minute
|
|
616
|
+
async requestPasswordReset(
|
|
617
|
+
@Args('input') input: RequestPasswordResetInput,
|
|
618
|
+
@Context() context: any,
|
|
619
|
+
): Promise<PasswordResetResponse> {
|
|
620
|
+
return this.performRequestPasswordReset(input, context) as Promise<PasswordResetResponse>;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
@Mutation(() => PasswordResetResponse, {
|
|
624
|
+
name: 'resetPassword',
|
|
625
|
+
description: 'Reset password using verification code',
|
|
626
|
+
})
|
|
627
|
+
@Throttle({ default: { limit: 5, ttl: 900000 } }) // 5 attempts per 15 minutes
|
|
628
|
+
async resetPassword(
|
|
629
|
+
@Args('input') input: ResetPasswordInput,
|
|
630
|
+
@Context() context: any,
|
|
631
|
+
): Promise<PasswordResetResponse> {
|
|
632
|
+
return this.performResetPassword(input, context) as Promise<PasswordResetResponse>;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
#### Step 5: Deploy & Test
|
|
638
|
+
|
|
639
|
+
```bash
|
|
640
|
+
# Run migration
|
|
641
|
+
npx prisma migrate deploy
|
|
642
|
+
|
|
643
|
+
# Start dev server
|
|
644
|
+
npm run start:dev
|
|
645
|
+
|
|
646
|
+
# Test GraphQL API
|
|
647
|
+
curl -X POST http://localhost:3000/graphql \
|
|
648
|
+
-H "Content-Type: application/json" \
|
|
649
|
+
-d '{"query":"mutation { requestPasswordReset(input: {email: \"test@example.com\"}) { success message } }"}'
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
### GraphQL Schema
|
|
653
|
+
|
|
654
|
+
After setup, your schema will include:
|
|
655
|
+
|
|
656
|
+
```graphql
|
|
657
|
+
type Mutation {
|
|
658
|
+
requestPasswordReset(input: RequestPasswordResetInput!): PasswordResetResponse!
|
|
659
|
+
resetPassword(input: ResetPasswordInput!): PasswordResetResponse!
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
input RequestPasswordResetInput {
|
|
663
|
+
email: String!
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
input ResetPasswordInput {
|
|
667
|
+
email: String!
|
|
668
|
+
code: String!
|
|
669
|
+
newPassword: String!
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
type PasswordResetResponse {
|
|
673
|
+
success: Boolean!
|
|
674
|
+
message: String!
|
|
675
|
+
retryAfterSeconds: Int
|
|
676
|
+
}
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
### Error Handling
|
|
680
|
+
|
|
681
|
+
**Expected Exceptions:**
|
|
682
|
+
|
|
683
|
+
| Exception | HTTP Status | When Thrown | Client Action |
|
|
684
|
+
|-----------|-------------|-------------|---------------|
|
|
685
|
+
| `PasswordResetRateLimitException` | 429 | < 60 seconds since last request | Display countdown: "Try again in X seconds" |
|
|
686
|
+
| `WeakPasswordException` | 400 | Password doesn't meet requirements | Show validation errors to user |
|
|
687
|
+
| `AccountLockedException` | 403 | Account locked due to brute force | Show "Account locked" message |
|
|
688
|
+
| `UnauthorizedException` | 401 | Invalid/expired code | "Code is invalid or expired" |
|
|
689
|
+
|
|
690
|
+
**Example Client-Side Error Handling (GraphQL):**
|
|
691
|
+
|
|
692
|
+
```typescript
|
|
693
|
+
try {
|
|
694
|
+
const result = await client.mutate({
|
|
695
|
+
mutation: RESET_PASSWORD_MUTATION,
|
|
696
|
+
variables: { input: { email, code, newPassword } },
|
|
697
|
+
});
|
|
698
|
+
|
|
699
|
+
if (result.data?.resetPassword?.success) {
|
|
700
|
+
// Redirect to login
|
|
701
|
+
router.push('/login');
|
|
702
|
+
}
|
|
703
|
+
} catch (error) {
|
|
704
|
+
if (error.extensions?.code === 'BAD_REQUEST') {
|
|
705
|
+
// WeakPasswordException
|
|
706
|
+
showErrors(error.extensions.errors); // ["Password must contain uppercase", ...]
|
|
707
|
+
} else if (error.extensions?.code === 'TOO_MANY_REQUESTS') {
|
|
708
|
+
// PasswordResetRateLimitException
|
|
709
|
+
const retryAfter = error.extensions.retryAfterSeconds;
|
|
710
|
+
showCountdown(retryAfter);
|
|
711
|
+
} else if (error.message.includes('invalid or expired')) {
|
|
712
|
+
// UnauthorizedException
|
|
713
|
+
showError('Code is invalid or expired');
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
```
|
|
717
|
+
|
|
718
|
+
### Security Considerations
|
|
719
|
+
|
|
720
|
+
1. **Never reveal whether email exists**
|
|
721
|
+
- Always return success message, even for non-existent emails
|
|
722
|
+
- Client cannot enumerate valid email addresses
|
|
723
|
+
|
|
724
|
+
2. **Rate limiting is essential**
|
|
725
|
+
- Implement both per-user (60s) AND per-IP (via @Throttle) limits
|
|
726
|
+
- Prevents abuse and spam
|
|
727
|
+
|
|
728
|
+
3. **Code security**
|
|
729
|
+
- Codes are HMAC-SHA256 hashed in database (never plain text)
|
|
730
|
+
- Constant-time comparison prevents timing attacks
|
|
731
|
+
- 15-minute expiry limits exposure window
|
|
732
|
+
- Single-use enforcement prevents replay attacks
|
|
733
|
+
|
|
734
|
+
4. **Token revocation**
|
|
735
|
+
- All refresh tokens are invalidated on password change
|
|
736
|
+
- Forces re-authentication on all devices
|
|
737
|
+
- Prevents attacker from maintaining access
|
|
738
|
+
|
|
739
|
+
5. **Email template security**
|
|
740
|
+
- Do NOT include personalized reset URLs with embedded tokens
|
|
741
|
+
- Use 6-digit codes displayed in email (user manually enters in app)
|
|
742
|
+
- Prevents phishing attacks via link manipulation
|
|
743
|
+
|
|
744
|
+
### Lifecycle Hooks
|
|
745
|
+
|
|
746
|
+
Optionally track password reset events:
|
|
747
|
+
|
|
748
|
+
```typescript
|
|
749
|
+
export class AppAuthHooks implements IAuthLifecycleHooks<User> {
|
|
750
|
+
async onPasswordReset(user: User): Promise<void> {
|
|
751
|
+
// Send security alert to user's phone
|
|
752
|
+
await this.smsService.send(user.phoneNumber, 'Your password was just changed');
|
|
753
|
+
|
|
754
|
+
// Log to analytics
|
|
755
|
+
await this.analytics.track(user.id, 'password_reset_completed');
|
|
756
|
+
|
|
757
|
+
// Revoke API keys (if your app has them)
|
|
758
|
+
await this.apiKeyService.revokeAllKeys(user.id);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
```
|
|
762
|
+
|
|
460
763
|
## GraphQL API
|
|
461
764
|
|
|
462
765
|
The package provides a complete GraphQL API:
|
|
@@ -513,6 +816,23 @@ mutation VerifyPhone($input: VerifyPhoneInput!) {
|
|
|
513
816
|
}
|
|
514
817
|
}
|
|
515
818
|
|
|
819
|
+
# Password Reset Request
|
|
820
|
+
mutation RequestPasswordReset($input: RequestPasswordResetInput!) {
|
|
821
|
+
requestPasswordReset(input: $input) {
|
|
822
|
+
success
|
|
823
|
+
message
|
|
824
|
+
retryAfterSeconds
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
# Password Reset Confirmation
|
|
829
|
+
mutation ResetPassword($input: ResetPasswordInput!) {
|
|
830
|
+
resetPassword(input: $input) {
|
|
831
|
+
success
|
|
832
|
+
message
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
|
|
516
836
|
# Google OAuth Account Linking
|
|
517
837
|
mutation LinkGoogleAccount($input: LinkGoogleAccountInput!) {
|
|
518
838
|
linkGoogleAccount(linkGoogleAccountInput: $input) {
|
package/dist/auth.module.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { IVerificationRepository } from './interfaces/verification-repository.in
|
|
|
9
9
|
import { IBruteForceRepository } from './interfaces/brute-force-repository.interface';
|
|
10
10
|
import { IBiometricRepository } from './interfaces/biometric-repository.interface';
|
|
11
11
|
import { IAuthLogger } from './interfaces/auth-logger.interface';
|
|
12
|
+
import { PasswordPolicyConfig } from './interfaces/password-policy-config.interface';
|
|
12
13
|
export interface AuthModuleOptions {
|
|
13
14
|
userRepositoryInstance: IUserRepository;
|
|
14
15
|
refreshTokenRepositoryInstance: IRefreshTokenRepository;
|
|
@@ -58,12 +59,14 @@ export interface AuthModuleOptions {
|
|
|
58
59
|
};
|
|
59
60
|
};
|
|
60
61
|
encryptionKey?: string;
|
|
62
|
+
passwordPolicy?: PasswordPolicyConfig;
|
|
63
|
+
rateLimiterInstance?: any;
|
|
61
64
|
}
|
|
62
65
|
export interface AuthModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
63
66
|
useFactory: (...args: any[]) => Promise<AuthModuleOptions> | AuthModuleOptions;
|
|
64
67
|
inject?: any[];
|
|
65
68
|
}
|
|
66
|
-
export { AUTH_MODULE_OPTIONS, USER_REPOSITORY, REFRESH_TOKEN_REPOSITORY, EMAIL_SERVICE, SMS_SERVICE, AUTH_LIFECYCLE_HOOKS, VERIFICATION_REPOSITORY, BRUTE_FORCE_REPOSITORY, BIOMETRIC_REPOSITORY, AUTH_LOGGER, } from './constants';
|
|
69
|
+
export { AUTH_MODULE_OPTIONS, USER_REPOSITORY, REFRESH_TOKEN_REPOSITORY, EMAIL_SERVICE, SMS_SERVICE, AUTH_LIFECYCLE_HOOKS, VERIFICATION_REPOSITORY, BRUTE_FORCE_REPOSITORY, BIOMETRIC_REPOSITORY, AUTH_LOGGER, RATE_LIMITER, } from './constants';
|
|
67
70
|
export declare class AuthModule {
|
|
68
71
|
static forRootAsync(options: AuthModuleAsyncOptions): DynamicModule;
|
|
69
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../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AAE,MAAM,CAAC;IAMtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAK/B,KAAK,CAAC,EAAE;QACN,MAAM,CAAC,EAAE;YACP,QAAQ,EAAE,MAAM,CAAC;YACjB,YAAY,EAAE,MAAM,CAAC;YACrB,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;QACF,QAAQ,CAAC,EAAE;YACT,QAAQ,EAAE,MAAM,CAAC;YACjB,YAAY,EAAE,MAAM,CAAC;YACrB,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;KACH,CAAC;IAOF,aAAa,CAAC,EAAE,MAAM,CAAC;IAsBvB,cAAc,CAAC,EAAE,oBAAoB,CAAC;IAqBtC,mBAAmB,CAAC,EAAE,GAAG,CAAC;CAC3B;AAKD,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC;IAC7E,UAAU,EAAE,CACV,GAAG,IAAI,EAAE,GAAG,EAAE,KACX,OAAO,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAAC;IACpD,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;CAChB;AAMD,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACX,YAAY,GACb,MAAM,aAAa,CAAC;AAyCrB,qBACa,UAAU;IA+BrB,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,sBAAsB,GAAG,aAAa;CAgPpE"}
|
package/dist/auth.module.js
CHANGED
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
var AuthModule_1;
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.AuthModule = exports.AUTH_LOGGER = exports.BIOMETRIC_REPOSITORY = exports.BRUTE_FORCE_REPOSITORY = exports.VERIFICATION_REPOSITORY = exports.AUTH_LIFECYCLE_HOOKS = exports.SMS_SERVICE = exports.EMAIL_SERVICE = exports.REFRESH_TOKEN_REPOSITORY = exports.USER_REPOSITORY = exports.AUTH_MODULE_OPTIONS = void 0;
|
|
10
|
+
exports.AuthModule = exports.RATE_LIMITER = exports.AUTH_LOGGER = exports.BIOMETRIC_REPOSITORY = exports.BRUTE_FORCE_REPOSITORY = exports.VERIFICATION_REPOSITORY = exports.AUTH_LIFECYCLE_HOOKS = exports.SMS_SERVICE = exports.EMAIL_SERVICE = exports.REFRESH_TOKEN_REPOSITORY = exports.USER_REPOSITORY = exports.AUTH_MODULE_OPTIONS = void 0;
|
|
11
11
|
const common_1 = require("@nestjs/common");
|
|
12
12
|
const jwt_1 = require("@nestjs/jwt");
|
|
13
13
|
const passport_1 = require("@nestjs/passport");
|
|
@@ -31,6 +31,7 @@ const noop_brute_force_repository_1 = require("./repositories/noop-brute-force.r
|
|
|
31
31
|
const noop_biometric_repository_1 = require("./repositories/noop-biometric.repository");
|
|
32
32
|
const console_logger_service_1 = require("./services/console-logger.service");
|
|
33
33
|
const constants_1 = require("./constants");
|
|
34
|
+
const in_memory_rate_limiter_service_1 = require("./services/in-memory-rate-limiter.service");
|
|
34
35
|
var constants_2 = require("./constants");
|
|
35
36
|
Object.defineProperty(exports, "AUTH_MODULE_OPTIONS", { enumerable: true, get: function () { return constants_2.AUTH_MODULE_OPTIONS; } });
|
|
36
37
|
Object.defineProperty(exports, "USER_REPOSITORY", { enumerable: true, get: function () { return constants_2.USER_REPOSITORY; } });
|
|
@@ -42,6 +43,7 @@ Object.defineProperty(exports, "VERIFICATION_REPOSITORY", { enumerable: true, ge
|
|
|
42
43
|
Object.defineProperty(exports, "BRUTE_FORCE_REPOSITORY", { enumerable: true, get: function () { return constants_2.BRUTE_FORCE_REPOSITORY; } });
|
|
43
44
|
Object.defineProperty(exports, "BIOMETRIC_REPOSITORY", { enumerable: true, get: function () { return constants_2.BIOMETRIC_REPOSITORY; } });
|
|
44
45
|
Object.defineProperty(exports, "AUTH_LOGGER", { enumerable: true, get: function () { return constants_2.AUTH_LOGGER; } });
|
|
46
|
+
Object.defineProperty(exports, "RATE_LIMITER", { enumerable: true, get: function () { return constants_2.RATE_LIMITER; } });
|
|
45
47
|
let AuthModule = AuthModule_1 = class AuthModule {
|
|
46
48
|
static forRootAsync(options) {
|
|
47
49
|
const optionsProvider = {
|
|
@@ -141,6 +143,13 @@ let AuthModule = AuthModule_1 = class AuthModule {
|
|
|
141
143
|
return opts.authLoggerInstance || new console_logger_service_1.ConsoleAuthLogger();
|
|
142
144
|
},
|
|
143
145
|
},
|
|
146
|
+
{
|
|
147
|
+
provide: constants_1.RATE_LIMITER,
|
|
148
|
+
inject: [constants_1.AUTH_MODULE_OPTIONS],
|
|
149
|
+
useFactory: (opts) => {
|
|
150
|
+
return opts.rateLimiterInstance || new in_memory_rate_limiter_service_1.InMemoryRateLimiterService();
|
|
151
|
+
},
|
|
152
|
+
},
|
|
144
153
|
auth_service_1.AuthService,
|
|
145
154
|
refresh_token_service_1.RefreshTokenService,
|
|
146
155
|
verification_service_1.VerificationService,
|
package/dist/auth.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../src/auth.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAyE;AACzE,qCAAwC;AACxC,+CAAkD;AAIlD,0DAAsD;AACtD,4EAAuE;AACvE,0EAAsE;AACtE,sEAAkE;AAClE,wEAAmE;AACnE,8FAAwF;AAExF,8EAAyE;AAEzE,8FAAyF;AACzF,wFAAkF;AAGlF,4DAAwD;AACxD,kEAA8D;AAC9D,sEAAkE;AAClE,4EAAuE;AACvE,gFAA2E;AAG3E,mEAA+D;AAc/D,8FAAyF;AACzF,4FAAsF;AACtF,wFAAmF;AACnF,8EAAsE;AAGtE,
|
|
1
|
+
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../src/auth.module.ts"],"names":[],"m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GAAG,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC;wBACnD,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,YAAY,CAAC;wBAE3D,IAAI,CAAC,QAAQ,IAAI,CAAC,YAAY,EAAE,CAAC;4BAC/B,eAAM,CAAC,IAAI,CACT,oJAAoJ,EACpJ,YAAY,CACb,CAAC;4BACF,OAAO,IAAI,6CAAoB,EAAE,CAAC;wBACpC,CAAC;wBAGD,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;4BAC3B,MAAM,IAAI,KAAK,CACb,yEAAyE;gCACzE,mEAAmE;gCACnE,0FAA0F,CAC3F,CAAC;wBACJ,CAAC;wBAED,OAAO,IAAI,oCAAgB,CAAC,OAAO,CAAC,CAAC;oBACvC,CAAC;iBACF;aAMF;YACD,OAAO,EAAE;gBACP,+BAAmB;gBACnB,0BAAW;gBACX,2CAAmB;gBACnB,0CAAmB;gBACnB,sCAAiB;gBACjB,uCAAiB;gBACjB,4DAA2B;gBAE3B,6CAAoB;gBAEpB,6DAA4B;gBAC5B,sDAAwB;gBACxB,uBAAW;gBACX,2BAAe;gBACf,oCAAwB;gBACxB,eAAS;gBACT,yBAAc;aACf;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AA/QY,gCAAU;qBAAV,UAAU;IADtB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,UAAU,CA+QtB"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ export declare const VERIFICATION_REPOSITORY = "VERIFICATION_REPOSITORY";
|
|
|
8
8
|
export declare const BRUTE_FORCE_REPOSITORY = "BRUTE_FORCE_REPOSITORY";
|
|
9
9
|
export declare const BIOMETRIC_REPOSITORY = "BIOMETRIC_REPOSITORY";
|
|
10
10
|
export declare const AUTH_LOGGER = "AUTH_LOGGER";
|
|
11
|
+
export declare const RATE_LIMITER = "RATE_LIMITER";
|
|
11
12
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAMzD,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAMjD,eAAO,MAAM,wBAAwB,6BAA6B,CAAC;AAMnE,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAM7C,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAMzC,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAM3D,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AAMjE,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAM/D,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAO3D,eAAO,MAAM,WAAW,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAMzD,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAMjD,eAAO,MAAM,wBAAwB,6BAA6B,CAAC;AAMnE,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAM7C,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAMzC,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAM3D,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AAMjE,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAM/D,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAO3D,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAOzC,eAAO,MAAM,YAAY,iBAAiB,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AUTH_LOGGER = exports.BIOMETRIC_REPOSITORY = exports.BRUTE_FORCE_REPOSITORY = exports.VERIFICATION_REPOSITORY = exports.AUTH_LIFECYCLE_HOOKS = exports.SMS_SERVICE = exports.EMAIL_SERVICE = exports.REFRESH_TOKEN_REPOSITORY = exports.USER_REPOSITORY = exports.AUTH_MODULE_OPTIONS = void 0;
|
|
3
|
+
exports.RATE_LIMITER = exports.AUTH_LOGGER = exports.BIOMETRIC_REPOSITORY = exports.BRUTE_FORCE_REPOSITORY = exports.VERIFICATION_REPOSITORY = exports.AUTH_LIFECYCLE_HOOKS = exports.SMS_SERVICE = exports.EMAIL_SERVICE = exports.REFRESH_TOKEN_REPOSITORY = exports.USER_REPOSITORY = exports.AUTH_MODULE_OPTIONS = void 0;
|
|
4
4
|
exports.AUTH_MODULE_OPTIONS = 'AUTH_MODULE_OPTIONS';
|
|
5
5
|
exports.USER_REPOSITORY = 'USER_REPOSITORY';
|
|
6
6
|
exports.REFRESH_TOKEN_REPOSITORY = 'REFRESH_TOKEN_REPOSITORY';
|
|
@@ -11,4 +11,5 @@ exports.VERIFICATION_REPOSITORY = 'VERIFICATION_REPOSITORY';
|
|
|
11
11
|
exports.BRUTE_FORCE_REPOSITORY = 'BRUTE_FORCE_REPOSITORY';
|
|
12
12
|
exports.BIOMETRIC_REPOSITORY = 'BIOMETRIC_REPOSITORY';
|
|
13
13
|
exports.AUTH_LOGGER = 'AUTH_LOGGER';
|
|
14
|
+
exports.RATE_LIMITER = 'RATE_LIMITER';
|
|
14
15
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAgBa,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AAM5C,QAAA,eAAe,GAAG,iBAAiB,CAAC;AAMpC,QAAA,wBAAwB,GAAG,0BAA0B,CAAC;AAMtD,QAAA,aAAa,GAAG,eAAe,CAAC;AAMhC,QAAA,WAAW,GAAG,aAAa,CAAC;AAM5B,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAM9C,QAAA,uBAAuB,GAAG,yBAAyB,CAAC;AAMpD,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAMlD,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAO9C,QAAA,WAAW,GAAG,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAgBa,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AAM5C,QAAA,eAAe,GAAG,iBAAiB,CAAC;AAMpC,QAAA,wBAAwB,GAAG,0BAA0B,CAAC;AAMtD,QAAA,aAAa,GAAG,eAAe,CAAC;AAMhC,QAAA,WAAW,GAAG,aAAa,CAAC;AAM5B,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAM9C,QAAA,uBAAuB,GAAG,yBAAyB,CAAC;AAMpD,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAMlD,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAO9C,QAAA,WAAW,GAAG,aAAa,CAAC;AAO5B,QAAA,YAAY,GAAG,cAAc,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,10 @@ export * from './interfaces/auth-logger.interface';
|
|
|
11
11
|
export * from './interfaces/verification-repository.interface';
|
|
12
12
|
export * from './interfaces/brute-force-repository.interface';
|
|
13
13
|
export * from './interfaces/biometric-repository.interface';
|
|
14
|
+
export * from './interfaces/password-policy-config.interface';
|
|
15
|
+
export * from './interfaces/rate-limiter.interface';
|
|
16
|
+
export * from './interfaces/password-reset-strategy.interface';
|
|
17
|
+
export * from './interfaces/magic-link-repository.interface';
|
|
14
18
|
export * from './services/auth.service';
|
|
15
19
|
export * from './services/refresh-token.service';
|
|
16
20
|
export * from './services/verification.service';
|
|
@@ -20,6 +24,8 @@ export * from './services/brute-force-protection.service';
|
|
|
20
24
|
export * from './services/biometric-auth.service';
|
|
21
25
|
export * from './services/biometric-verification.service';
|
|
22
26
|
export * from './services/oauth-linking-token.service';
|
|
27
|
+
export * from './services/password-validation.service';
|
|
28
|
+
export * from './services/in-memory-rate-limiter.service';
|
|
23
29
|
export * from './services/sendgrid-email.service';
|
|
24
30
|
export * from './services/twilio-sms.service';
|
|
25
31
|
export * from './services/noop-email.service';
|
|
@@ -28,11 +34,15 @@ export * from './services/console-logger.service';
|
|
|
28
34
|
export * from './repositories/noop-verification.repository';
|
|
29
35
|
export * from './repositories/noop-brute-force.repository';
|
|
30
36
|
export * from './repositories/noop-biometric.repository';
|
|
37
|
+
export * from './repositories/noop-rate-limiter';
|
|
38
|
+
export * from './repositories/noop-magic-link.repository';
|
|
31
39
|
export * from './strategies/jwt.strategy';
|
|
32
40
|
export * from './strategies/google.strategy';
|
|
33
41
|
export * from './strategies/facebook.strategy';
|
|
34
42
|
export * from './strategies/noop-google.strategy';
|
|
35
43
|
export * from './strategies/noop-facebook.strategy';
|
|
44
|
+
export * from './strategies/verification-code.strategy';
|
|
45
|
+
export * from './strategies/magic-link.strategy';
|
|
36
46
|
export * from './resolvers/base-auth.resolver';
|
|
37
47
|
export * from './resolvers/oauth.controller';
|
|
38
48
|
export { AuthResponseBase } from './dto/auth-response.dto';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAK5B,cAAc,kCAAkC,CAAC;AACjD,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wCAAwC,CAAC;AACvD,cAAc,iDAAiD,CAAC;AAChE,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6C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@@ -28,6 +28,10 @@ __exportStar(require("./interfaces/auth-logger.interface"), exports);
|
|
|
28
28
|
__exportStar(require("./interfaces/verification-repository.interface"), exports);
|
|
29
29
|
__exportStar(require("./interfaces/brute-force-repository.interface"), exports);
|
|
30
30
|
__exportStar(require("./interfaces/biometric-repository.interface"), exports);
|
|
31
|
+
__exportStar(require("./interfaces/password-policy-config.interface"), exports);
|
|
32
|
+
__exportStar(require("./interfaces/rate-limiter.interface"), exports);
|
|
33
|
+
__exportStar(require("./interfaces/password-reset-strategy.interface"), exports);
|
|
34
|
+
__exportStar(require("./interfaces/magic-link-repository.interface"), exports);
|
|
31
35
|
__exportStar(require("./services/auth.service"), exports);
|
|
32
36
|
__exportStar(require("./services/refresh-token.service"), exports);
|
|
33
37
|
__exportStar(require("./services/verification.service"), exports);
|
|
@@ -37,6 +41,8 @@ __exportStar(require("./services/brute-force-protection.service"), exports);
|
|
|
37
41
|
__exportStar(require("./services/biometric-auth.service"), exports);
|
|
38
42
|
__exportStar(require("./services/biometric-verification.service"), exports);
|
|
39
43
|
__exportStar(require("./services/oauth-linking-token.service"), exports);
|
|
44
|
+
__exportStar(require("./services/password-validation.service"), exports);
|
|
45
|
+
__exportStar(require("./services/in-memory-rate-limiter.service"), exports);
|
|
40
46
|
__exportStar(require("./services/sendgrid-email.service"), exports);
|
|
41
47
|
__exportStar(require("./services/twilio-sms.service"), exports);
|
|
42
48
|
__exportStar(require("./services/noop-email.service"), exports);
|
|
@@ -45,11 +51,15 @@ __exportStar(require("./services/console-logger.service"), exports);
|
|
|
45
51
|
__exportStar(require("./repositories/noop-verification.repository"), exports);
|
|
46
52
|
__exportStar(require("./repositories/noop-brute-force.repository"), exports);
|
|
47
53
|
__exportStar(require("./repositories/noop-biometric.repository"), exports);
|
|
54
|
+
__exportStar(require("./repositories/noop-rate-limiter"), exports);
|
|
55
|
+
__exportStar(require("./repositories/noop-magic-link.repository"), exports);
|
|
48
56
|
__exportStar(require("./strategies/jwt.strategy"), exports);
|
|
49
57
|
__exportStar(require("./strategies/google.strategy"), exports);
|
|
50
58
|
__exportStar(require("./strategies/facebook.strategy"), exports);
|
|
51
59
|
__exportStar(require("./strategies/noop-google.strategy"), exports);
|
|
52
60
|
__exportStar(require("./strategies/noop-facebook.strategy"), exports);
|
|
61
|
+
__exportStar(require("./strategies/verification-code.strategy"), exports);
|
|
62
|
+
__exportStar(require("./strategies/magic-link.strategy"), exports);
|
|
53
63
|
__exportStar(require("./resolvers/base-auth.resolver"), exports);
|
|
54
64
|
__exportStar(require("./resolvers/oauth.controller"), exports);
|
|
55
65
|
__exportStar(require("./dto/login.input"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAYA,gDAA8B;AAC9B,8CAA4B;AAK5B,mEAAiD;AACjD,yEAAuD;AACvD,uEAAqD;AACrD,qEAAmD;AACnD,8EAA4D;AAC5D,yEAAuD;AACvD,kFAAgE;AAChE,qEAAmD;AACnD,iFAA+D;AAC/D,gFAA8D;AAC9D,8EAA4D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAYA,gDAA8B;AAC9B,8CAA4B;AAK5B,mEAAiD;AACjD,yEAAuD;AACvD,uEAAqD;AACrD,qEAAmD;AACnD,8EAA4D;AAC5D,yEAAuD;AACvD,kFAAgE;AAChE,qEAAmD;AACnD,iFAA+D;AAC/D,gFAA8D;AAC9D,8EAA4D;AAC5D,gFAA8D;AAC9D,sEAAoD;AACpD,iFAA+D;AAC/D,+EAA6D;AAK7D,0DAAwC;AACxC,mEAAiD;AACjD,kEAAgD;AAChD,gEAA8C;AAC9C,iEAA+C;AAC/C,4EAA0D;AAE1D,oEAAkD;AAElD,4EAA0D;AAC1D,yEAAuD;AACvD,yEAAuD;AACvD,4EAA0D;AAK1D,oEAAkD;AAClD,gEAA8C;AAC9C,gEAA8C;AAC9C,8DAA4C;AAC5C,oEAAkD;AAKlD,8EAA4D;AAC5D,6EAA2D;AAC3D,2EAAyD;AACzD,mEAAiD;AACjD,4EAA0D;AAK1D,4DAA0C;AAC1C,+DAA6C;AAC7C,iEAA+C;AAC/C,oEAAkD;AAClD,sEAAoD;AACpD,0EAAwD;AACxD,mEAAiD;AAKjD,iEAA+C;AAG/C,+DAA6C;AAM7C,oDAAkC;AAClC,qDAAmC;AACnC,4DAA0C;AAC1C,qDAAmC;AACnC,4DAA0C;AAC1C,2DAAyC;AACzC,kEAAgD;AAChD,sEAAoD;AACpD,2DAAyC;AACzC,wEAAsD;AACtD,sEAAoD;AACpD,kEAAgD;AAChD,uEAAqD;AACrD,oEAAkD;AAClD,2EAAyD;AACzD,gEAA8C;AAC9C,8DAA4C;AAC5C,6DAA2C;AAC3C,+DAA6C;AAC7C,+DAA6C;AAC7C,yEAAuD;AACvD,iEAA+C;AAC/C,gEAA8C;AAC9C,6EAA2D;AAC3D,8DAA4C;AAC5C,qEAAmD;AACnD,6DAA2C;AAC3C,oEAAkD;AAKlD,sEAAoD;AAKpD,0DAAwC;AAKxC,gEAAuD;AAA9C,4GAAA,QAAQ,OAAA;AAKjB,wEAAsD;AACtD,uEAAqD;AACrD,gEAA8C;AAC9C,yEAAuD;AAKvD,iEAA+C;AAK/C,2DAAyC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface IMagicLinkRepository {
|
|
2
|
+
storeMagicLink(userId: string, tokenHash: string, expiresAt: Date): Promise<void>;
|
|
3
|
+
validateMagicLink(userId: string, tokenHash: string): Promise<boolean>;
|
|
4
|
+
deleteMagicLink(userId: string): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=magic-link-repository.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magic-link-repository.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/magic-link-repository.interface.ts"],"names":[],"mappings":"AAoDA,MAAM,WAAW,oBAAoB;IAkBnC,cAAc,CACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,IAAI,GACd,OAAO,CAAC,IAAI,CAAC,CAAC;IAyBjB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAiBvE,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magic-link-repository.interface.js","sourceRoot":"","sources":["../../src/interfaces/magic-link-repository.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface PasswordPolicyConfig {
|
|
2
|
+
minLength?: number;
|
|
3
|
+
maxLength?: number;
|
|
4
|
+
requireUppercase?: boolean;
|
|
5
|
+
requireLowercase?: boolean;
|
|
6
|
+
requireNumber?: boolean;
|
|
7
|
+
requireSpecialChar?: boolean;
|
|
8
|
+
customValidator?: (password: string) => Promise<{
|
|
9
|
+
isValid: boolean;
|
|
10
|
+
errors: string[];
|
|
11
|
+
}> | {
|
|
12
|
+
isValid: boolean;
|
|
13
|
+
errors: string[];
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=password-policy-config.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-policy-config.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/password-policy-config.interface.ts"],"names":[],"mappings":"AAqCA,MAAM,WAAW,oBAAoB;IAKnC,SAAS,CAAC,EAAE,MAAM,CAAC;IAOnB,SAAS,CAAC,EAAE,MAAM,CAAC;IAMnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAM3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAM3B,aAAa,CAAC,EAAE,OAAO,CAAC;IAOxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IA0B7B,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,GAAG;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAClI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-policy-config.interface.js","sourceRoot":"","sources":["../../src/interfaces/password-policy-config.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface IPasswordResetStrategy {
|
|
2
|
+
generateResetToken(userId: string): Promise<string>;
|
|
3
|
+
validateResetToken(userId: string, token: string): Promise<boolean>;
|
|
4
|
+
getExpiryDuration(): number;
|
|
5
|
+
deleteResetToken(userId: string): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=password-reset-strategy.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-reset-strategy.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/password-reset-strategy.interface.ts"],"names":[],"mappings":"AA0DA,MAAM,WAAW,sBAAsB;IA0BrC,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IA0BpD,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAiBpE,iBAAiB,IAAI,MAAM,CAAC;IAmB5B,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-reset-strategy.interface.js","sourceRoot":"","sources":["../../src/interfaces/password-reset-strategy.interface.ts"],"names":[],"mappings":""}
|