Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

chore: load terms of service & privacy policy links from env variables (#2963)

Akash Ka24d724e2ba3
diff --git a/.env.example b/.env.example
index 986790310..ec618a0d4 100644
--- a/.env.example
+++ b/.env.example
@@ -22,6 +22,10 @@ VITE_SHORTCODE_BASE_URL=https://hopp.sh
VITE_BACKEND_GQL_URL=https://api.hoppscotch.io/graphql
VITE_BACKEND_WS_URL=wss://api.hoppscotch.io/graphql
+# Terms Of Service And Privacy Policy Links (Optional)
+VITE_APP_TOS_LINK=https://docs.hoppscotch.io/terms
+VITE_APP_PRIVACY_POLICY_LINK=https://docs.hoppscotch.io/privacy
+
# Sentry (Optional)
# VITE_SENTRY_DSN: <Sentry DSN here>
# VITE_SENTRY_ENVIRONMENT: <Sentry environment value here>
diff --git a/packages/hoppscotch-common/src/components/firebase/Login.vue b/packages/hoppscotch-common/src/components/firebase/Login.vue
index f37409e60..85e3638c9 100644
--- a/packages/hoppscotch-common/src/components/firebase/Login.vue
+++ b/packages/hoppscotch-common/src/components/firebase/Login.vue
@@ -76,18 +76,21 @@
</div>
</template>
<template #footer>
- <div v-if="mode === 'sign-in'" class="text-secondaryLight text-tiny">
+ <div
+ v-if="mode === 'sign-in' && tosLink && privacyPolicyLink"
+ class="text-secondaryLight text-tiny"
+ >
By signing in, you are agreeing to our
<HoppSmartAnchor
class="link"
- to="https://docs.hoppscotch.io/terms"
+ :to="tosLink"
blank
label="Terms of Service"
/>
and
<HoppSmartAnchor
class="link"
- to="https://docs.hoppscotch.io/privacy"
+ :to="privacyPolicyLink"
blank
label="Privacy Policy"
/>
@@ -141,6 +144,9 @@ export default defineComponent({
setup() {
const { subscribeToStream } = useStreamSubscriber()
+ const tosLink = import.meta.env.VITE_APP_TOS_LINK
+ const privacyPolicyLink = import.meta.env.VITE_APP_PRIVACY_POLICY_LINK
+
return {
subscribeToStream,
t: useI18n(),
@@ -150,6 +156,8 @@ export default defineComponent({
IconEmail,
IconMicrosoft,
IconArrowLeft,
+ tosLink,
+ privacyPolicyLink,
}
},
data() {