api: Add baseUrl to templates

This commit is contained in:
Paul Bienkowski 2021-02-28 22:36:11 +01:00
parent 5b4ec4d69e
commit 46466874da
6 changed files with 10 additions and 8 deletions

View file

@ -53,6 +53,7 @@ function isValidScope(scope) {
router.use((req, res, next) => {
res.locals.user = req.user;
res.locals.mainFrontendUrl = config.mainFrontendUrl;
res.locals.baseUrl = baseUrl;
next();
});

View file

@ -9,9 +9,9 @@ block content
minutes time for your decision.
.authorization
form(method="post", action="/authorize/decline")
form(method="post", action="authorize/decline")
button(type="submit", class="red") Decline
form(method="post", action="/authorize/approve")
form(method="post", action="authorize/approve")
button(type="submit", class="green") Approve

View file

@ -1,5 +1,6 @@
html
head
base(href=baseUrl)
title
block title
| Authorization Server
@ -133,10 +134,10 @@ html
if mainFrontendUrl
li: a(href=mainFrontendUrl) Back to Portal
if !user
li: a(href="/login") Login
li: a(href="/register") Register
li: a(href="login") Login
li: a(href="register") Register
if user
li: a(href="/logout") Logout
li: a(href="logout") Logout
header: h1
block title
block content

View file

@ -17,4 +17,4 @@ block content
p.message.error Invalid login credentials, please try again.
button(type="submit", style="margin-right: 2rem") Login
a(href="/forgot-password") I forgot my password
a(href="forgot-password") I forgot my password

View file

@ -4,5 +4,5 @@ block title
| Logout
block content
form(method="post", action="/logout")
form(method="post", action="logout")
button(type="submit", class="red") Log out now

View file

@ -8,4 +8,4 @@ block content
div(class="message " + type)= description
if showLoginButton
p: a(href="/login") Go to login
p: a(href="login") Go to login