-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relecture de examples/*
#22
Conversation
Signed-off-by: Bruno Lesieur <bruno.lesieur@gmail.com>
en/examples/auth-routes.md
Outdated
@@ -67,7 +69,8 @@ app.listen(3000) | |||
console.log('Server is listening on http://localhost:3000') | |||
``` | |||
|
|||
And we update our `package.json` scripts: | |||
Et nous modifions nos script dans `package.json` : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"nos scripts"
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)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"afin d'obtenir"
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L'action
Bwarf, pas très réveillé moi aujourd'hui... Merci @rspt ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quelques erreurs et remarques. C'est du très bon boulot !!!
en/examples/auth-routes.md
Outdated
github: auth-routes | ||
livedemo: https://nuxt-auth-routes.gomix.me | ||
liveedit: https://gomix.com/#!/project/nuxt-auth-routes | ||
--- | ||
|
||
# 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nuxt.js peut être utilisé pour créer facilement des routes authentifiées facilement .
en/examples/auth-routes.md
Outdated
@@ -48,16 +50,16 @@ app.post('/api/login', function (req, res) { | |||
res.status(401).json({ error: 'Bad credentials' }) | |||
}) | |||
|
|||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
désauthentifier => déconnecter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je mets « connecter » plus haut pour rester cohérant
en/examples/auth-routes.md
Outdated
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
je vais mettre « reste connecté entre les pages » pour coller à across effectivement.
en/examples/auth-routes.md
Outdated
```bash | ||
yarn add express express-session body-parser whatwg-fetch | ||
``` | ||
|
||
*We will talk about `whatwg-fetch` later.* | ||
*Nous parlerons de `whatwg-fetch` dans un instant.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ç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
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appelle => appellera
en/examples/auth-routes.md
Outdated
```js | ||
login ({ commit }, { username, password }) { | ||
return fetch('/api/login', { | ||
// Send the client cookies to the server | ||
// Envoyer les cookies client au serveur |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Envoyer => Envoie
en/examples/auth-routes.md
Outdated
|
||
```js | ||
logout ({ commit }) { | ||
return fetch('/api/logout', { | ||
// Send the client cookies to the server | ||
// Envoyer les cookies au serveur |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Envoyer => Envoie
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
en/examples/auth-routes.md
Outdated
```bash | ||
yarn add express express-session body-parser whatwg-fetch | ||
``` | ||
|
||
*We will talk about `whatwg-fetch` later.* | ||
*Nous parlerons de `whatwg-fetch` dans un instant.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ç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
@@ -48,16 +50,16 @@ app.post('/api/login', function (req, res) { | |||
res.status(401).json({ error: 'Bad credentials' }) | |||
}) | |||
|
|||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je mets « connecter » plus haut pour rester cohérant
en/examples/auth-routes.md
Outdated
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
je vais mettre « reste connecté entre les pages » pour coller à across effectivement.
Tous les exemples revus