Rework user types: create AuthenticatedUser and AnonymousUser class

Both are subclasses of an abstract User class which contains almost everything
interesting.
This commit is contained in:
2026-01-17 17:45:36 -06:00
parent 350bf7c865
commit d921679058
9 changed files with 102 additions and 62 deletions

View File

@@ -1,13 +1,13 @@
import { AuthService } from "../auth";
import { getCurrentUser } from "../context";
import { PostgresAuthStore } from "../database";
import type { MaybeUser } from "../user";
import type { User } from "../user";
import { html, redirect, render } from "./util";
const util = { html, redirect, render };
const session = {
getUser: (): MaybeUser => {
getUser: (): User => {
return getCurrentUser();
},
};