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:
@@ -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();
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user