tangled
alpha
login
or
join now
yoyle.city
/
skittr
6
fork
atom
this repo has no description
atproto
bluesky
typescript
express
6
fork
atom
overview
issues
3
pulls
pipelines
auth fix
lime360
3 months ago
0232dcbc
7083542b
1/1
test.yml
success
12s
+5
-18
2 changed files
expand all
collapse all
unified
split
src
lib
auth.ts
routes
main.ts
-13
src/lib/auth.ts
reviewed
···
1
1
-
import { Request, Response, NextFunction } from "express";
2
2
-
3
3
-
export default async function auth(req: Request, res: Response, next: NextFunction) {
4
4
-
const { handle, accessJwt, refreshJwt } = req.cookies;
5
5
-
6
6
-
if (!handle || !accessJwt || !refreshJwt) return res.redirect("/login");
7
7
-
8
8
-
req.session.handle = handle;
9
9
-
req.session.accessJwt = accessJwt;
10
10
-
req.session.refreshJwt = refreshJwt;
11
11
-
12
12
-
next();
13
13
-
}
+5
-5
src/routes/main.ts
reviewed
···
43
43
}
44
44
});
45
45
46
46
-
router.get("/home", auth, async (req: Request, res: Response) => {
46
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
232
-
router.post("/status", auth, async (req: Request, res: Response) => {
232
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
267
-
router.get("/like", auth, async (req: Request, res: Response) => {
267
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
280
-
router.post("/follow", auth, async (req: Request, res: Response) => {
280
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
294
-
router.post("/unfollow", auth, async (req: Request, res: Response) => {
294
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);