Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions apps/backend/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ import rateLimit from '@fastify/rate-limit';
import fastifyStatic from '@fastify/static';
import Fastify, {type FastifyInstance} from 'fastify';

declare module 'fastify' {
interface FastifyInstance {
authenticate: any;
}
}


import { prismaPlugin } from './plugins/prisma.js';
import { redisPlugin } from './plugins/redis.js';
import { analyticsRoutes } from './routes/analytics.js';
Expand Down Expand Up @@ -96,9 +89,6 @@ export async function buildApp():Promise<FastifyInstance> {
// ─── Auth Decorator ───
app.decorate('authenticate', async function (request: any, reply: any) {
try {
if (!request.headers.authorization && request.cookies && request.cookies.token) {
request.headers.authorization = `Bearer ${request.cookies.token}`;
}
await request.jwtVerify();
} catch (_err) {
reply.status(401).send({ error: 'Unauthorized' });
Expand Down
24 changes: 0 additions & 24 deletions apps/backend/src/routes/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,30 +351,6 @@ app.get('/github/callback', async (request: FastifyRequest<{ Querystring: OAuthC
reply.clearCookie('token', { path: '/' });
return { message: 'Logged out' };
});

// ─── Dev Login Bypass ───
if (process.env.NODE_ENV !== 'production') {
app.get('/dev-login', async (request: FastifyRequest, reply: FastifyReply) => {
const user = await app.prisma.user.findUnique({
where: { username: 'devcard-demo' },
});
if (!user) {
return reply.status(404).send({ error: 'Demo user not found' });
}
const token = app.jwt.sign(
{ id: user.id, username: user.username },
{ expiresIn: '30d' }
);
reply.setCookie('token', token, {
httpOnly: true,
secure: false,
sameSite: 'lax',
path: '/',
maxAge: 30 * 24 * 60 * 60,
});
return reply.redirect(`${process.env.PUBLIC_APP_URL || 'http://localhost:5173'}/devcard/analytics`);
});
}
}

function generateState(): string {
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/routes/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ app.get('/github', {
const tokenData = (await tokenRes.json()) as any;

if (tokenData.error) {
app.log.error(tokenData, 'GitHub connect token error');
app.log.error('GitHub connect token error:', tokenData);
return reply.redirect(`${process.env.PUBLIC_APP_URL}/settings?error=connect_failed`);
}

Expand Down
5 changes: 0 additions & 5 deletions apps/web/postcss.config.js

This file was deleted.

89 changes: 0 additions & 89 deletions apps/web/src/routes/devcard/analytics/+page.server.ts

This file was deleted.

Loading