diff options
Diffstat (limited to '003-Authentification.md')
-rw-r--r-- | 003-Authentification.md | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/003-Authentification.md b/003-Authentification.md new file mode 100644 index 0000000..14bd1cd --- /dev/null +++ b/003-Authentification.md @@ -0,0 +1,37 @@ +Authentification +================ + +On va utiliser la gem [Clearance](https://github.com/thoughtbot/clearance) pour +nous donner de l'authentification. + + +1. Ouvrez le `Gemfile` et ajoutez cette ligne : + + gem 'clearance' + +2. Utilizes Bundler pour installer la gem : + + bundle install + +3. Pour installer Clearance, faitez : + + rails generate clearance:install + +4. Lancez les migrations : + + rails db:migrate + +5. Relancez le serveur Rails + +4. Ajoutez cet HTML (copiƩ du README de Clearance) dans le `<body>` du + `layouts/application.html.erb` : + + <% if signed_in? %> + <%= current_user.email %> + <%= button_to "Sign out", sign_out_path, method: :delete %> + <% else %> + <%= link_to "Sign in", sign_in_path %> + <% end %> + +4. Inscription et connexion sont maintenant possibles depuis l'interface web de + l'application. |