Skip to content

Commit

Permalink
added devise for base level auth
Browse files Browse the repository at this point in the history
  • Loading branch information
jarodtaylor committed Sep 16, 2024
1 parent 7bf7b72 commit 5d31f5e
Show file tree
Hide file tree
Showing 11 changed files with 495 additions and 24 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ gem "pg", "~> 1.1"
gem "puma", ">= 5.0"
gem "turbo-rails"
gem "stimulus-rails"
gem "devise"
gem "jbuilder"
gem "tzinfo-data", platforms: %i[ windows jruby ]
gem "bootsnap", require: false
Expand Down
14 changes: 14 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ GEM
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.2)
base64 (0.2.0)
bcrypt (3.1.20)
bigdecimal (3.1.8)
bindex (0.8.1)
bootsnap (1.18.4)
Expand All @@ -98,6 +99,12 @@ GEM
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
devise (4.9.4)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
drb (2.2.1)
dry-cli (1.1.0)
erubi (1.13.0)
Expand Down Expand Up @@ -150,6 +157,7 @@ GEM
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
orm_adapter (0.5.0)
parallel (1.26.3)
parser (3.3.5.0)
ast (~> 2.4.1)
Expand Down Expand Up @@ -207,6 +215,9 @@ GEM
regexp_parser (2.9.2)
reline (0.5.10)
io-console (~> 0.5)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.3.7)
rubocop (1.66.1)
json (~> 2.3)
Expand Down Expand Up @@ -265,6 +276,8 @@ GEM
dry-cli (>= 0.7, < 2)
rack-proxy (~> 0.6, >= 0.6.1)
zeitwerk (~> 2.2)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
Expand Down Expand Up @@ -292,6 +305,7 @@ DEPENDENCIES
brakeman
capybara
debug
devise
jbuilder
pg (~> 1.1)
puma (>= 5.0)
Expand Down
6 changes: 6 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable
end
44 changes: 21 additions & 23 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title><%= content_for?(:title) ? strip_tags(yield(:title)) : "Ror Vite Tailwind" %></title>
<meta name="apple-mobile-web-app-title" content="Ror Vite Tailwind">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="mobile-web-app-capable" content="yes">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>

<%= yield :head %>

<link rel="manifest" href="/manifest.json">
<link rel="icon" href="/icon.png" type="image/png">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/icon.png">

<%= vite_client_tag %>
<%= vite_stylesheet_tag 'application', data: { "turbo-track": "reload" } %>
<%= vite_javascript_tag "application", "data-turbo-track": "reload" %>
</head>

<body>
<%= yield %>
</body>
<head>
<title><%= content_for?(:title) ? strip_tags(yield(:title)) : "Ror Vite Tailwind" %></title>
<meta name="apple-mobile-web-app-title" content="Ror Vite Tailwind">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="mobile-web-app-capable" content="yes">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= yield :head %>
<link rel="manifest" href="/manifest.json">
<link rel="icon" href="/icon.png" type="image/png">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/icon.png">
<%= vite_client_tag %>
<%= vite_stylesheet_tag 'application', data: { "turbo-track": "reload" } %>
<%= vite_javascript_tag "application", "data-turbo-track": "reload" %>
</head>
<body>
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
<%= yield %>
</body>
</html>
Loading

0 comments on commit 5d31f5e

Please sign in to comment.