feat(auth): add handler specs and improve auth infrastructure
Add unit tests for get-profile, get-agent-by-user-id, and verify-kyc handlers. Improve OAuth service, local strategy, and repository implementations with proper ConfigService injection and error handling. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -34,15 +34,17 @@ const QueryHandlers = [GetProfileHandler, GetAgentByUserIdHandler];
|
||||
imports: [
|
||||
CqrsModule,
|
||||
PassportModule,
|
||||
JwtModule.register({
|
||||
secret: (() => {
|
||||
JwtModule.registerAsync({
|
||||
useFactory: () => {
|
||||
const secret = process.env['JWT_SECRET'];
|
||||
if (!secret) {
|
||||
throw new Error('JWT_SECRET environment variable is required');
|
||||
}
|
||||
return secret;
|
||||
})(),
|
||||
signOptions: { expiresIn: '15m', audience: 'goodgo-api', issuer: 'goodgo-platform' },
|
||||
return {
|
||||
secret,
|
||||
signOptions: { expiresIn: '15m', audience: 'goodgo-api', issuer: 'goodgo-platform' },
|
||||
};
|
||||
},
|
||||
}),
|
||||
],
|
||||
controllers: [AuthController, OAuthController],
|
||||
|
||||
Reference in New Issue
Block a user