diff --git a/Gemfile b/Gemfile
index 1bffb16..90243de 100644
--- a/Gemfile
+++ b/Gemfile
@@ -41,6 +41,9 @@ gem "tzinfo-data", platforms: %i[mswin mswin64 mingw x64_mingw jruby]
# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false
+#Authentication
+gem 'bcrypt', '~> 3.1.7'
+
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"
diff --git a/Gemfile.lock b/Gemfile.lock
index ac261d3..96e0c75 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -79,6 +79,7 @@ GEM
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
base64 (0.2.0)
+ bcrypt (3.1.20)
bigdecimal (3.1.8)
bindex (0.8.1)
bootsnap (1.18.3)
@@ -307,6 +308,7 @@ PLATFORMS
x86_64-linux
DEPENDENCIES
+ bcrypt (~> 3.1.7)
bootsnap
capybara
debug
diff --git a/app/views/articles/index.html.erb b/app/views/articles/index.html.erb
index 7428945..635f0ad 100644
--- a/app/views/articles/index.html.erb
+++ b/app/views/articles/index.html.erb
@@ -1,5 +1,6 @@
Articles
<%= link_to 'Add an article', new_article_path, class: 'btn btn-primary' %>
+<%= link_to 'Create User', new_user_path, class: 'btn btn-secondary' %>
<% @articles.each do |article| %>
diff --git a/config/routes.rb b/config/routes.rb
index 21791b8..c849984 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,6 +1,7 @@
Rails.application.routes.draw do
root "articles#index"
resources :articles
+ resources :users, only: [:new, :create]
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end
diff --git a/db/schema.rb b/db/schema.rb
index ed17b1b..9b6a0cf 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[7.1].define(version: 2024_06_06_181615) do
+ActiveRecord::Schema[7.1].define(version: 2024_06_10_000010) do
create_table "articles", force: :cascade do |t|
t.string "title", null: false
t.text "link", null: false
@@ -18,4 +18,12 @@
t.datetime "updated_at", null: false
end
+ create_table "users", force: :cascade do |t|
+ t.string "name"
+ t.string "email"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.string "password_digest", null: false
+ end
+
end