← Back to all features

The diff you deserve

Unified diff viewer with file status badges, staged/unstaged split, and full-file toggle. You'll still stare at diffs for 20 minutes, but now they're pretty.

SZ
WD
HC
🏠
PR#24 ×
Auth refactor ×
Search endpoint ×
Rate limiting ×
Auth refactor
▸_ Terminal◧ Browser± Diff⎇ Git
JWT middleware rewritten
Token refresh added
src/types/auth.d.ts — updated

Running tests... 14 passed

src/middleware/auth.ts −23+47
@@ -1,12 +1,18 @@
1 import { Request, Response, Next } from 'express';
2-import { getSession } from '../utils/session';
3-import { SessionStore } from '../types/session';
2+import { verifyToken, TokenPayload } from '../utils/jwt';
3+import { AuthError } from '../types/auth';
4
5-export async function authMiddleware(req, res, next) {
6- const session = await getSession(req.cookies.sid);
7- if (!session) return res.status(401).end();
5+export async function authMiddleware(
6+ req: Request, res: Response, next: Next
7+) {
8+ const token = req.headers.authorization?.split(' ')[1];
9+ if (!token) throw new AuthError('NO_TOKEN');
10+ const payload = await verifyToken(token);
11+ req.user = payload.user;
12 next();
13 }
src/utils/jwt.ts +32
@@ -0,0 +1,32 @@
1+import jwt from 'jsonwebtoken';
2+import { TokenPayload } from '../types/auth';
3+
4+export function verifyToken(token: string): TokenPayload {
5+ return jwt.verify(token, process.env.JWT_SECRET);
6+}

Review is where a lot of agent-assisted workflows still fall apart. The diff view is built to make file-by-file inspection fast without bouncing to another tool.

Staged and unstaged changes stay separated, file state stays visible, and full-file views help when a compact hunk view is not enough to understand the shape of the edit.

This turns review from a context switch into a normal part of finishing work inside the task card.

Have a question about how this works in practice? Check the SlayZone FAQ or read about all features.

← Previous Stage, commit, ship Next → Full commit graph, per task