this repo has no description
atproto bluesky typescript express

auth fix

+5 -18
-13
src/lib/auth.ts
··· 1 - import { Request, Response, NextFunction } from "express"; 2 - 3 - export default async function auth(req: Request, res: Response, next: NextFunction) { 4 - const { handle, accessJwt, refreshJwt } = req.cookies; 5 - 6 - if (!handle || !accessJwt || !refreshJwt) return res.redirect("/login"); 7 - 8 - req.session.handle = handle; 9 - req.session.accessJwt = accessJwt; 10 - req.session.refreshJwt = refreshJwt; 11 - 12 - next(); 13 - }
+5 -5
src/routes/main.ts
··· 43 43 } 44 44 }); 45 45 46 - router.get("/home", auth, async (req: Request, res: Response) => { 46 + router.get("/home", async (req: Request, res: Response) => { 47 47 const agent = (req as any).agent; 48 48 const cursor = (req.query.cursor as string) || ""; 49 49 const handle = req.session.handle as string; ··· 229 229 }, 230 230 ); 231 231 232 - router.post("/status", auth, async (req: Request, res: Response) => { 232 + router.post("/status", async (req: Request, res: Response) => { 233 233 const { mobile_text_content, layout } = req.body; 234 234 const agent = (req as any).agent; 235 235 ··· 264 264 } 265 265 }); 266 266 267 - router.get("/like", auth, async (req: Request, res: Response) => { 267 + router.get("/like", async (req: Request, res: Response) => { 268 268 const { postUri, cid } = req.params; 269 269 const agent = (req as any).agent; 270 270 ··· 277 277 } 278 278 }); 279 279 280 - router.post("/follow", auth, async (req: Request, res: Response) => { 280 + router.post("/follow", async (req: Request, res: Response) => { 281 281 const { user } = req.body; 282 282 const agent = (req as any).agent; 283 283 const targetDid = await getActorDid(agent, user); ··· 291 291 } 292 292 }); 293 293 294 - router.post("/unfollow", auth, async (req: Request, res: Response) => { 294 + router.post("/unfollow", async (req: Request, res: Response) => { 295 295 const { user } = req.body; 296 296 const agent = (req as any).agent; 297 297 const targetDid = await getActorDid(agent, user);