Conversation
Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
en/examples/auth-routes.md
Outdated
| ``` | ||
|
|
||
| And we update our `package.json` scripts: | ||
| Et nous modifions nos script dans `package.json` : |
en/examples/auth-routes.md
Outdated
| 3. We create our `SET_USER` mutation which will set the `state.authUser` to the connected user | ||
| 4. We export our store instance to Nuxt.js can inject it to our main application | ||
| 1. Nous importons `Vue` et `Vuex` (inclus dans Nuxt.js) et nous indiquons à Vue d'utiliser Vuex afin de pouvoir utiliser `$store` dans nos composants. | ||
| 2. Nous utilisons `require('whatwg-fetch')` afin de d'obtenur un polyfill pour la méthode `fetch()` pour tous les navigateurs (consultez le [dépôt fetch](https://github.com/github/fetch)). |
en/examples/auth-routes.md
Outdated
|
|
||
| 1. returning a `Promise`, nuxt.js will wait for the promise to be resolved before rendering the component. | ||
| 2. Using the [async/await proposal](https://github.com/lukehoban/ecmascript-asyncawait) ([learn more about it](https://zeit.co/blog/async-and-await)) | ||
| ### L'ation login() |
|
Bwarf, pas très réveillé moi aujourd'hui... Merci @rspt ! |
forresst
left a comment
There was a problem hiding this comment.
Quelques erreurs et remarques. C'est du très bon boulot !!!
en/examples/auth-routes.md
Outdated
| # Documentation | ||
|
|
||
| > Nuxt.js can be used to create authenticated routes easily. | ||
| > Nuxt.js peut être utilisé pour créer des routes authentifiées facilement. |
There was a problem hiding this comment.
Nuxt.js peut être utilisé pour créer facilement des routes authentifiées facilement .
en/examples/auth-routes.md
Outdated
| }) | ||
|
|
||
| // POST /api/logout to log out the user and remove it from the req.session | ||
| // Accès à `/api/logout` en POST pour désauthentifier l'utilisateur et le retirer de `req.session` |
There was a problem hiding this comment.
Je mets « connecter » plus haut pour rester cohérant
en/examples/auth-routes.md
Outdated
| ## Utilisation du store | ||
|
|
||
| We need a global state to let our application know if the user is connected **across the pages**. | ||
| Nous avons besoin d'un état global pour informer notre application si l'utilisateur est **connecté sur les pages**. |
There was a problem hiding this comment.
Nous avons besoin d'un état global pour savoir si l'utilisateur est toujours connecté sur les différentes pages de notre application.
"across" dans cette phrase indique le passage d'une page à une autre, donc ne pas perdre la connexion lors du passage d'une page à l'autre. Ma proposition me parait plus en adéquation avec l'original. Ton avis ?
There was a problem hiding this comment.
je vais mettre « reste connecté entre les pages » pour coller à across effectivement.
en/examples/auth-routes.md
Outdated
| ``` | ||
|
|
||
| *We will talk about `whatwg-fetch` later.* | ||
| *Nous parlerons de `whatwg-fetch` dans un instant.* |
There was a problem hiding this comment.
Nous parlerons de whatwg-fetch plus tard.
"Dans un instant", cela correspond "à toute de suite" : ce n'est pas le cas
There was a problem hiding this comment.
Ça correspond plutôt à d'ici quelque minutes. Ce qui correspond au temps moyen de lecture avant qu'on se penche sur ce truc.
Je vais mettre plus loin sous entendu « plus loin dans le texte ».
en/examples/auth-routes.md
Outdated
| ### Fonction nuxtServerInit() | ||
|
|
||
| Nuxt.js will call a specific action called `nuxtServerInit` with the context in argument, so when the app will be loaded, the store will be already filled with some data we can get from the server. | ||
| Nuxt.js appelle une action spécifique nommée `nuxtServerInit` avec le contexte comme argument. Ainsi, lorsque l'application sera chargée, le store sera déjà rempli avec certaines données que nous pouvons obtenir du serveur. |
en/examples/auth-routes.md
Outdated
| login ({ commit }, { username, password }) { | ||
| return fetch('/api/login', { | ||
| // Send the client cookies to the server | ||
| // Envoyer les cookies client au serveur |
en/examples/auth-routes.md
Outdated
| logout ({ commit }) { | ||
| return fetch('/api/logout', { | ||
| // Send the client cookies to the server | ||
| // Envoyer les cookies au serveur |
en/examples/auth-routes.md
Outdated
| ``` | ||
|
|
||
| *We will talk about `whatwg-fetch` later.* | ||
| *Nous parlerons de `whatwg-fetch` dans un instant.* |
There was a problem hiding this comment.
Ça correspond plutôt à d'ici quelque minutes. Ce qui correspond au temps moyen de lecture avant qu'on se penche sur ce truc.
Je vais mettre plus loin sous entendu « plus loin dans le texte ».
en/examples/auth-routes.md
Outdated
| }) | ||
|
|
||
| // POST /api/logout to log out the user and remove it from the req.session | ||
| // Accès à `/api/logout` en POST pour désauthentifier l'utilisateur et le retirer de `req.session` |
There was a problem hiding this comment.
Je mets « connecter » plus haut pour rester cohérant
en/examples/auth-routes.md
Outdated
| ## Utilisation du store | ||
|
|
||
| We need a global state to let our application know if the user is connected **across the pages**. | ||
| Nous avons besoin d'un état global pour informer notre application si l'utilisateur est **connecté sur les pages**. |
There was a problem hiding this comment.
je vais mettre « reste connecté entre les pages » pour coller à across effectivement.
Tous les exemples revus