Skip to content

Commit

Permalink
refactor(front): use runtimeConfig instead of env
Browse files Browse the repository at this point in the history
  • Loading branch information
nojhamster committed Nov 5, 2021
1 parent 2ffb6d0 commit 92f3be9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ services:
args:
- http_proxy
- https_proxy
- EZMESURE_DISABLE_SHIBBOLETH
ports:
- 8080:8080
environment:
- API_URL=https://${EZMESURE_DOMAIN}/api
- EZMESURE_DISABLE_SHIBBOLETH
- PORT=8080
- HOST=0.0.0.0
restart: unless-stopped
Expand Down
1 change: 0 additions & 1 deletion front/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ COPY package.json /usr/src/app/
RUN npm install && npm cache clean --force
COPY . /usr/src/app

ARG EZMESURE_DISABLE_SHIBBOLETH
RUN npm run build

ENTRYPOINT ["npm", "start"]
5 changes: 4 additions & 1 deletion front/components/space/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
block
color="red lighten-2"
dark
href="/Shibboleth.sso/Logout?return=/logout"
:href="logoutUrl"
v-text="$t('menu.logout')"
/>
</div>
Expand All @@ -97,6 +97,9 @@ export default {
};
},
computed: {
logoutUrl() {
return this.$config.shibbolethEnabled ? '/Shibboleth.sso/Logout?return=/logout' : '/logout';
},
links() {
return [
{ title: this.$t('menu.profile'), href: '/myspace' },
Expand Down
1 change: 1 addition & 0 deletions front/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = {
],
ssr: false,
telemetry: false,
publicRuntimeConfig: {
shibbolethEnabled: !process.env.EZMESURE_DISABLE_SHIBBOLETH,
},
modules: [
Expand Down
3 changes: 1 addition & 2 deletions front/pages/myspace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ export default {
components: {
ToolBar,
},
asyncData({ env }) {
data() {
return {
logoutUrl: env.shibbolethEnabled ? '/Shibboleth.sso/Logout?return=/logout' : '/logout',
selectedFiles: [],
token: '',
};
Expand Down

0 comments on commit 92f3be9

Please sign in to comment.