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) => { router.use((req, res, next) => {
res.locals.user = req.user; res.locals.user = req.user;
res.locals.mainFrontendUrl = config.mainFrontendUrl; res.locals.mainFrontendUrl = config.mainFrontendUrl;
res.locals.baseUrl = baseUrl;
next(); next();
}); });

View file

@ -9,9 +9,9 @@ block content
minutes time for your decision. minutes time for your decision.
.authorization .authorization
form(method="post", action="/authorize/decline") form(method="post", action="authorize/decline")
button(type="submit", class="red") 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 button(type="submit", class="green") Approve

View file

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

View file

@ -17,4 +17,4 @@ block content
p.message.error Invalid login credentials, please try again. p.message.error Invalid login credentials, please try again.
button(type="submit", style="margin-right: 2rem") Login 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 | Logout
block content block content
form(method="post", action="/logout") form(method="post", action="logout")
button(type="submit", class="red") Log out now button(type="submit", class="red") Log out now

View file

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