aboutsummaryrefslogtreecommitdiff
path: root/pages/admin/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'pages/admin/index.js')
-rw-r--r--pages/admin/index.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/pages/admin/index.js b/pages/admin/index.js
index cbb5086..2a73fc1 100644
--- a/pages/admin/index.js
+++ b/pages/admin/index.js
@@ -27,7 +27,12 @@ export async function getServerSideProps(context) {
}
const admin = sessions?.user?.name === process.env.ADMIN_USERNAME;
- const api = process.env.API_URI;
+
+ let api;
+ api = process.env.API_URI;
+ if (api.endsWith("/")) {
+ api = api.slice(0, -1);
+ }
if (!admin) {
return {