Split services into core and request

This commit is contained in:
2026-01-17 16:19:32 -06:00
parent e59bb35ac9
commit 8a7682e953
12 changed files with 76 additions and 73 deletions

View File

@@ -1,13 +1,13 @@
import { SESSION_COOKIE_NAME } from "../auth/token";
import { services } from "../services";
import type { Call, Result, Route } from "../types";
import { request } from "../request";
import { redirect } from "../request/util";
import type { Call, Result, Route } from "../types";
const logoutHandler = async (call: Call): Promise<Result> => {
// Extract token from cookie and invalidate the session
const token = services.auth.extractToken(call.request);
const token = request.auth.extractToken(call.request);
if (token) {
await services.auth.logout(token);
await request.auth.logout(token);
}
// Clear the cookie and redirect to login