Newer
Older
This section explains the way we handle terms in the application.
## Description
The terms version is handled with the _io.cozy.terms_ doctype. It is incremented each time we edit the CGU, the data consent validation or the legal notices. Once we increment the terms version, the user will be prompted to accept these terms, otherwise we won't be able to access the app.
### Private Routes
All routes are private, and are accessible only if the user has accepted the last version of the terms.
The only public routes are :
- _/terms_ : shows the terms validation page, and is the main page the user is redirected to if his consent is outdated
- _/cgu_ : shows the CGU public page, accessible by the terms page
- _/legal_ : shows the Legal Notice public page, accessible by the terms page
### Terms managment
We check the terms acceptation in the **SplashScreen** while the application is initializing, if there is no consent (first connexion), or the consent is outdated (update of terms), the user will be redirected to the terms acceptation page.
User has to check the two checboxes (one for Data share consent, and one for CGU and Legal Notice) to unlock the terms acceptation button. Once he has accepted it, a new term doctype is created with the value _accepted_ to true. So he can access now the entire application.
We store in user's profile a boolean _showConsentModal_ that allows the app to know about the consent status.
### Version number
The version number of the last terms is stored in the **config.json** file. If this version number doesn't correspond with the last term accepted, the user won't be able to access the app and wil be prompted to accept new terms.