feat: v1.1 - random re-roll, shopping summary, offline PWA, auth prep, profile page
This commit is contained in:
@@ -9,6 +9,7 @@ import { tagRoutes } from './routes/tags.js';
|
||||
import { imageRoutes } from './routes/images.js';
|
||||
import { botRoutes } from './routes/bot.js';
|
||||
import { ogScrapeRoutes } from './routes/og-scrape.js';
|
||||
import { authRoutes } from './routes/auth.js';
|
||||
|
||||
export async function buildApp() {
|
||||
const app = Fastify({ logger: true });
|
||||
@@ -43,5 +44,8 @@ export async function buildApp() {
|
||||
await app.register(ogScrapeRoutes);
|
||||
await app.after();
|
||||
|
||||
await app.register(authRoutes);
|
||||
await app.after();
|
||||
|
||||
return app;
|
||||
}
|
||||
|
||||
7
backend/src/middleware/auth.ts
Normal file
7
backend/src/middleware/auth.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { FastifyRequest, FastifyReply } from 'fastify';
|
||||
|
||||
// v2: Auth middleware — currently passes through everything
|
||||
export async function authMiddleware(request: FastifyRequest, _reply: FastifyReply) {
|
||||
// TODO v2: Verify JWT token, set request.user
|
||||
(request as any).user = { id: 'default', name: 'Luna' };
|
||||
}
|
||||
15
backend/src/routes/auth.ts
Normal file
15
backend/src/routes/auth.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { FastifyInstance } from 'fastify';
|
||||
|
||||
export async function authRoutes(app: FastifyInstance) {
|
||||
app.post('/api/auth/login', async (_request, reply) => {
|
||||
reply.status(501).send({ error: 'not implemented' });
|
||||
});
|
||||
|
||||
app.post('/api/auth/register', async (_request, reply) => {
|
||||
reply.status(501).send({ error: 'not implemented' });
|
||||
});
|
||||
|
||||
app.get('/api/auth/me', async (_request, reply) => {
|
||||
reply.status(501).send({ error: 'not implemented' });
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user