Skip to content

Commit

Permalink
Merge pull request #3341 from carlobeltrame/oauth-terms-of-service
Browse files Browse the repository at this point in the history
Terms of service must be accepted when using OAuth to register
  • Loading branch information
carlobeltrame committed Mar 14, 2023
2 parents ee88d4e + 1d4eafb commit d6e6b0e
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 11 deletions.
8 changes: 5 additions & 3 deletions frontend/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@
"title": "Dein Account wird aktiviert"
},
"login": {
"acceptTermsOfServiceOnOAuthLogin": "Beim Login via einen diese Services akzeptierst du die {termsOfServiceLink}.",
"accountless": "Hast du noch keinen Account?",
"email": "E-Mail",
"infoText": {
Expand All @@ -385,11 +386,12 @@
"jubladb": "JublaDB",
"midata": "MiData"
},
"registernow": "Jetzt registrieren"
"registernow": "Jetzt registrieren",
"termsOfServiceLink": "Nutzungsbedingungen"
},
"register": {
"acceptTermsOfUse": "Akzeptieren Sie die Nutzungsbedingungen",
"alreadyHaveAnAccount": "Haben Sie bereits ein Konto?",
"acceptTermsOfService": "Nutzungsbedingungen akzeptieren",
"alreadyHaveAnAccount": "Hast du bereits ein Konto?",
"passwordConfirmation": "Passwort erneut eingeben",
"register": "Registrieren",
"requiredField": "Pflichtfelder",
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@
"title": "Your account will be activated"
},
"login": {
"acceptTermsOfServiceOnOAuthLogin": "By logging in via one of these services, you accept the {termsOfServiceLink}.",
"accountless": "Don't have an account yet?",
"email": "Email",
"infoText": {
Expand All @@ -385,10 +386,11 @@
"jubladb": "JublaDB",
"midata": "MiData"
},
"registernow": "Register now"
"registernow": "Register now",
"termsOfServiceLink": "terms of service"
},
"register": {
"acceptTermsOfUse": "Accept the terms of use",
"acceptTermsOfService": "Accept the terms of service",
"alreadyHaveAnAccount": "Already have an account?",
"passwordConfirmation": "Enter password again",
"register": "Register",
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@
"title": "Ton compte sera activé"
},
"login": {
"acceptTermsOfServiceOnOAuthLogin": "En te connectant via l'un de ces services, tu acceptes les {termsOfServiceLink}.",
"accountless": "Vous n'avez pas encore de compte?",
"email": "Courriel",
"infoText": {
Expand All @@ -377,10 +378,11 @@
"jubladb": "Jubla",
"midata": "MiData"
},
"registernow": "Inscrivez-vous maintenant"
"registernow": "Inscrivez-vous maintenant",
"termsOfServiceLink": "conditions d'utilisation"
},
"register": {
"acceptTermsOfUse": "Accepter les conditions d'utilisation",
"acceptTermsOfService": "Accepter les conditions d'utilisation",
"alreadyHaveAnAccount": "Vous avez déjà un compte ?",
"passwordConfirmation": "Entrez à nouveau votre mot de passe",
"register": "S'inscrire",
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@
"title": "Il tuo account sarà attivato"
},
"login": {
"acceptTermsOfServiceOnOAuthLogin": "Effettuando l'accesso tramite uno di questi servizi, si accettano i {termsOfServiceLink}.",
"accountless": "Non hanno ancora un conto?",
"email": "Indirizzo e-mail",
"infoText": {
Expand All @@ -377,10 +378,11 @@
"jubladb": "JublaDB",
"midata": "MiData"
},
"registernow": "Iscriviti ora"
"registernow": "Iscriviti ora",
"termsOfServiceLink": "condizioni di utilizzo"
},
"register": {
"acceptTermsOfUse": "Accettare le condizioni di utilizzo",
"acceptTermsOfService": "Accettare le condizioni di utilizzo",
"alreadyHaveAnAccount": "Hai già un conto?",
"passwordConfirmation": "Inserisci di nuovo la password",
"register": "Registrati",
Expand Down
22 changes: 22 additions & 0 deletions frontend/src/views/auth/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@
$tc('views.auth.login.provider.google')
}}</span>
</v-btn>
<small class="w-100">
<i18n
path="views.auth.login.acceptTermsOfServiceOnOAuthLogin"
tag="p"
class="text--secondary text-center w-100 mt-2"
style="hyphens: auto"
>
<template #termsOfServiceLink>
<a :href="termsOfServiceLink" target="_blank" style="color: gray">{{
$tc('views.auth.login.termsOfServiceLink')
}}</a>
</template>
</i18n>
</small>
</div>
<p class="mt-8 mb-0 text--secondary text-center">
{{ $tc('views.auth.login.accountless') }}<br />
Expand All @@ -134,6 +148,7 @@ import AuthContainer from '@/components/layout/AuthContainer.vue'
import HorizontalRule from '@/components/layout/HorizontalRule.vue'
import IconSpacer from '@/components/layout/IconSpacer.vue'
import { serverErrorToString } from '@/helpers/serverError'
import { parseTemplate } from 'url-template'
const LOGIN_INFO_TEXT_KEY = window.environment.LOGIN_INFO_TEXT_KEY
Expand Down Expand Up @@ -164,6 +179,13 @@ export default {
infoTextKey() {
return `views.auth.login.infoText.${LOGIN_INFO_TEXT_KEY ?? 'dev'}`
},
termsOfServiceLink() {
return (
parseTemplate(window.environment.TERMS_OF_SERVICE_LINK_TEMPLATE || '').expand({
lang: this.$store.state.lang.language.substring(0, 2),
}) || false
)
},
},
mounted() {
this.$store.commit('setLanguage', this.$i18n.browserPreferredLocale)
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/auth/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@
v-model="tos"
:vee-rules="{ required: { allowFalse: false } }"
class="align-center"
:name="$tc('views.auth.register.acceptTermsOfUse')"
:name="$tc('views.auth.register.acceptTermsOfService')"
>
<template #label>
<span style="hyphens: auto" :class="{ 'body-2': $vuetify.breakpoint.xsOnly }">
{{ $tc('views.auth.register.acceptTermsOfUse') }}
{{ $tc('views.auth.register.acceptTermsOfService') }}
</span>
</template>
<template #append>
Expand Down

0 comments on commit d6e6b0e

Please sign in to comment.