Skip to content

Commit e95e40e

Browse files
HarxhitShantKhatri
authored andcommitted
Revert "Feat/oauth rate limiting (#446)" (#461)
This reverts commit 7762fa2.
1 parent de88cf5 commit e95e40e

3 files changed

Lines changed: 4 additions & 89 deletions

File tree

apps/backend/src/app.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import Fastify, {type FastifyInstance} from 'fastify';
1212

1313
import { prismaPlugin } from './plugins/prisma.js';
1414
import { redisPlugin } from './plugins/redis.js';
15-
import { oauthRateLimitPlugin } from './plugins/oauthRateLimit.js';
1615
import { analyticsRoutes } from './routes/analytics.js';
1716
import { authRoutes } from './routes/auth.js';
1817
import { cardRoutes } from './routes/cards.js';
@@ -88,9 +87,6 @@ export async function buildApp():Promise<FastifyInstance> {
8887
if (process.env.NODE_ENV !== 'test') {
8988
await app.register(redisPlugin);
9089
}
91-
92-
// ─── OAuth Rate Limiting ───
93-
await app.register(oauthRateLimitPlugin);
9490
// ─── Auth Decorator ───
9591
app.decorate('authenticate', async function (request: any, reply: any) {
9692
try {

apps/backend/src/plugins/oauthRateLimit.ts

Lines changed: 0 additions & 81 deletions
This file was deleted.

apps/backend/src/routes/auth.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export async function authRoutes(app: FastifyInstance) {
2828
}
2929

3030
// GitHub OAuth start
31-
app.get('/github', { preHandler: [app.oauthStartRateLimit] }, async (request: FastifyRequest, reply: FastifyReply) => {
31+
app.get('/github', async (request: FastifyRequest, reply: FastifyReply) => {
3232
const redirectUri = `${process.env.BACKEND_URL}/auth/github/callback`;
3333
const clientState = (request.query as any).state || '';
3434
const mobileRedirectUri = (request.query as any).mobile_redirect_uri || '';
@@ -55,7 +55,7 @@ export async function authRoutes(app: FastifyInstance) {
5555
});
5656

5757
// GitHub OAuth callback
58-
app.get('/github/callback', { preHandler: [app.oauthCallbackRateLimit] }, async (request: FastifyRequest<{ Querystring: OAuthCallbackQuery }>, reply: FastifyReply) => {
58+
app.get('/github/callback', async (request: FastifyRequest<{ Querystring: OAuthCallbackQuery }>, reply: FastifyReply) => {
5959
const { code, state } = request.query;
6060
const storedState = request.cookies?.oauth_state;
6161
if (!state || !storedState || state !== storedState) {
@@ -151,7 +151,7 @@ export async function authRoutes(app: FastifyInstance) {
151151
});
152152

153153
// Google OAuth start
154-
app.get('/google', { preHandler: [app.oauthStartRateLimit] }, async (request: FastifyRequest, reply: FastifyReply) => {
154+
app.get('/google', async (request: FastifyRequest, reply: FastifyReply) => {
155155
const redirectUri = `${process.env.BACKEND_URL}/auth/google/callback`;
156156
const clientState = (request.query as any).state || '';
157157
const mobileRedirectUri = (request.query as any).mobile_redirect_uri || '';
@@ -180,7 +180,7 @@ export async function authRoutes(app: FastifyInstance) {
180180
});
181181

182182
// Google callback
183-
app.get('/google/callback', { preHandler: [app.oauthCallbackRateLimit] }, async (request: FastifyRequest<{ Querystring: OAuthCallbackQuery }>, reply: FastifyReply) => {
183+
app.get('/google/callback', async (request: FastifyRequest<{ Querystring: OAuthCallbackQuery }>, reply: FastifyReply) => {
184184
const { code, state } = request.query;
185185

186186
const storedState = request.cookies?.oauth_state;

0 commit comments

Comments
 (0)