Separate happy path utility functions for requests
This commit is contained in:
@@ -2,7 +2,7 @@ import { SESSION_COOKIE_NAME } from "../auth/token";
|
||||
import { tokenLifetimes } from "../auth/types";
|
||||
import { services } from "../services";
|
||||
import type { Call, Result, Route } from "../types";
|
||||
import { html, redirect, render } from "../util";
|
||||
import { html, redirect, render } from "../request/util";
|
||||
|
||||
const loginHandler = async (call: Call): Promise<Result> => {
|
||||
if (call.method === "GET") {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { SESSION_COOKIE_NAME } from "../auth/token";
|
||||
import { services } from "../services";
|
||||
import type { Call, Result, Route } from "../types";
|
||||
import { redirect } from "../util";
|
||||
import { redirect } from "../request/util";
|
||||
|
||||
const logoutHandler = async (call: Call): Promise<Result> => {
|
||||
// Extract token from cookie and invalidate the session
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { DateTime } from "ts-luxon";
|
||||
import { services } from "../services";
|
||||
import type { Call, Result, Route } from "../types";
|
||||
import { html, render } from "../util";
|
||||
import { html, render } from "../request/util";
|
||||
import { loginRoute } from "./login";
|
||||
import { logoutRoute } from "./logout";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user