Log in with Matrix

This commit is contained in:
Cadence Ember
2025-02-02 01:23:36 +13:00
parent 63cc089bdb
commit 443618b974
13 changed files with 222 additions and 23 deletions
+2 -1
View File
@@ -35,12 +35,13 @@ function render(event, filename, locals) {
pugCache.set(path, async (event, locals) => {
defaultContentType(event, "text/html; charset=utf-8")
const session = await useSession(event, {password: reg.as_token})
const managed = (session.data.managedGuilds || []).concat(session.data.matrixGuilds || [])
const rel = x => getRelativePath(event.path, x)
return template(Object.assign({},
getQuery(event), // Query parameters can be easily accessed on the top level but don't allow them to overwrite anything
globals, // Globals
locals, // Explicit locals overwrite globals in case we need to DI something
{session, event, rel} // These are assigned last so they overwrite everything else. It would be catastrophically bad if they can't be trusted.
{session, event, rel, managed} // These are assigned last so they overwrite everything else. It would be catastrophically bad if they can't be trusted.
))
})
/* c8 ignore start */