Stay on guild self service page after logging in

This commit is contained in:
Cadence Ember
2025-02-18 00:46:54 +13:00
parent 331f2f6a38
commit efd7cb3fd4
4 changed files with 29 additions and 13 deletions

View File

@@ -39,7 +39,14 @@ function render(event, filename, locals) {
defaultContentType(event, "text/html; charset=utf-8")
const session = await auth.useSession(event)
const managed = await auth.getManagedGuilds(event)
const rel = x => getRelativePath(event.path, x)
const rel = (to, paramsObject) => {
let result = getRelativePath(event.path, to)
if (paramsObject) {
const params = new URLSearchParams(paramsObject)
result += "?" + params.toString()
}
return result
}
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