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:
@@ -24,7 +24,14 @@ const routes: Record<string, Route> = {
|
||||
const me = request.session.getUser();
|
||||
|
||||
const email = me.toString();
|
||||
const c = await render("basic/home", { email });
|
||||
const showLogin = me.isAnonymous();
|
||||
const showLogout = !me.isAnonymous();
|
||||
|
||||
const c = await render("basic/home", {
|
||||
email,
|
||||
showLogin,
|
||||
showLogout,
|
||||
});
|
||||
|
||||
return html(c);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user