Skip to content

Commit

Permalink
Fix rootpath for onion onedomain
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNaif2018 committed Apr 5, 2023
1 parent 2dbea89 commit a10c5dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export default {
ONION_ADMIN_HOST: process.env.BITCART_ADMIN_ONION_HOST || "",
ADMIN_HOST: process.env.BITCART_ADMIN_HOST || "localhost:3000",
ROOTPATH: process.env.BITCART_STORE_ROOTPATH || "/",
ADMIN_ROOTPATH: process.env.BITCART_ADMIN_ROOTPATH || "/",
},
/*
** Plugins to load before mounting the App
Expand Down
4 changes: 3 additions & 1 deletion store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ export const getters = {
: ""
},
adminHost({ onion, env }, { onionAdminHost }) {
const rootPath = env.adminRootPath === "/" ? "" : env.adminRootPath
return onion && onionAdminHost
? onionAdminHost
? onionAdminHost + rootPath
: env.adminHost.replace(/^https?:\/\//, "")
},
onionURL({ env, path }, { onionHost }) {
Expand Down Expand Up @@ -115,6 +116,7 @@ export const actions = {
onionAdminHost: env.ONION_ADMIN_HOST,
adminHost: env.ADMIN_HOST,
rootPath: env.ROOTPATH,
adminRootPath: env.ADMIN_ROOTPATH,
})
if (req) {
commit("onion", req.headers.host.toLowerCase().endsWith(".onion"))
Expand Down

0 comments on commit a10c5dd

Please sign in to comment.