diff --git a/src/routes/auth.ts b/src/routes/auth.ts index 6450170..5bfdd4e 100644 --- a/src/routes/auth.ts +++ b/src/routes/auth.ts @@ -11,13 +11,6 @@ const chessVerificationSchema = Joi.object({ chessUsername: Joi.string().required(), }); -router.post( - '/chess-verify', - passport.authenticate('jwt', { session: false }), // Ensure user is authenticated - validateRequest(chessVerificationSchema), - authController.initiateChessVerification -); - router.post( '/chess-verify/confirm', passport.authenticate('jwt', { session: false }), // Ensure user is authenticated diff --git a/test/auth.test.ts b/test/auth.test.ts deleted file mode 100644 index 093d89f..0000000 --- a/test/auth.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -import request from 'supertest'; -import app from '../src/app'; -import { PrismaClient } from '@prisma/client'; -import { redisClient } from '../src/utils/redis'; - -const prisma = new PrismaClient(); - -describe('Auth Routes', () => { - beforeAll(async () => { - await prisma.$connect(); - }); - - afterAll(async () => { - await prisma.$disconnect(); - await redisClient.quit(); - }); - - describe('POST /api/auth/chess-verify', () => { - it('should return a verification code for a valid Chess.com username', async () => { - const response = await request(app) - .post('/api/auth/chess-verify') - .send({ chessUsername: 'validusername' }); - - expect(response.status).toBe(200); - expect(response.body).toHaveProperty('verificationCode'); - }); - - it('should return an error for an invalid Chess.com username', async () => { - const response = await request(app) - .post('/api/auth/chess-verify') - .send({ chessUsername: 'invalidusername' }); - - expect(response.status).toBe(400); - expect(response.body).toHaveProperty('error'); - }); - }); - - -}); \ No newline at end of file