Skip to content

[DB] [USERS] [DEVISE] install devise for user management

Charlotte Flament requested to merge development into staging

Goals

Add an authentication system to app

Breakdown

  • add devise initialization files
  • add devise callbacks to model User
  • add devise routes
  • add password & encryption to table users
  • add devise views

Changes

config

  • config/initializers/devise.rb: create file
  • config/locales/devise.en.yml : create file
  • config/environments/development.rb : action_mailer configured for local host

DB

  • db/migrate/20191203110532_add_devise_to_users.rb : migration to add devise to existing model User
  • db/schema.rb : add password & encrypted password
  • app/models/user.rb : callbacks added to model User
  • config/routes.rb : all devise routes created + root temporarily set up to "composts#index"

VIEWS

  • app/views/devise/: create views
  • app/views/layouts/application.html.erb: add header with temporary links to test sign in, sign up and sign out properly

Tests

  • opened /users/sign_up in localhost : page opened successfully
  • created user via users/sign_up in localhost : user logged successfully and user created (checked in console)
  • sign out through link in header : user logged out successfully

Links

Edited by Charlotte Flament

Merge request reports