this repo has no description
atproto bluesky typescript express

yeh

+4 -9
-2
src/agent.ts
··· 1 1 import { AtpAgent } from "@atproto/api"; 2 2 3 - // TODO: use a pds instead of bluesky's centralized services 4 3 export const agent = new AtpAgent({ 5 4 service: "https://bsky.social", 6 5 }); 7 6 8 - // TODO: use a database instead of the public api endpoint 9 7 export const pubagent = new AtpAgent({ 10 8 service: "https://public.api.bsky.app", 11 9 });
+1
src/global.d.ts
··· 5 5 handle?: string; 6 6 accessJwt?: string; 7 7 refreshJwt?: string; 8 + pds?: string; 8 9 } 9 10 }
+2 -6
src/lib/auth.ts
··· 1 1 import { Request, Response, NextFunction } from "express"; 2 2 3 - export default async function auth( 4 - req: Request, 5 - res: Response, 6 - next: NextFunction, 7 - ) { 3 + export default async function auth(req: Request, res: Response, next: NextFunction) { 8 4 const { handle, accessJwt, refreshJwt } = req.cookies; 9 5 10 - if (!handle || !accessJwt || !refreshJwt) res.redirect("/login"); 6 + if (!handle || !accessJwt || !refreshJwt) return res.redirect("/login"); 11 7 12 8 req.session.handle = handle; 13 9 req.session.accessJwt = accessJwt;
+1 -1
src/routes/main.ts
··· 291 291 }); 292 292 293 293 router.post("/sessions", async (req: Request, res: Response) => { 294 - const { username_or_email, password, layout } = req.body; 294 + const { username_or_email, password, layout, pds_url } = req.body; 295 295 296 296 try { 297 297 await agent.login({