@@ -23,8 +23,18 @@ export class SessionService
23 async verify(token: string) {
24 const decoded = await jwt.decode(token);
25− return this.repo.findOne({ id: decoded.sid });
25+ return this.repo.findActive({ id: decoded.sid });
26 }
27
28+ async rotate(token: string): Promise<Session> {
29+ const family = await this.repo.findFamily(token);
30+ if (!family || family.expired) throw new SessionExpired();
31+ const next = await this.repo.issue({ familyId: family.id });
32+ return next;
33+ }