├── .gitattributes
├── .gitignore
├── .ruby-version
├── Gemfile
├── Gemfile.lock
├── README.md
├── Rakefile
├── app
├── assets
│ ├── config
│ │ └── manifest.js
│ ├── images
│ │ ├── .keep
│ │ ├── btn_google_signin_dark_disabled_web.png
│ │ ├── btn_google_signin_dark_focus_web.png
│ │ ├── btn_google_signin_dark_normal_web.png
│ │ ├── btn_google_signin_dark_pressed_web.png
│ │ ├── btn_google_signin_light_disabled_web.png
│ │ ├── btn_google_signin_light_focus_web.png
│ │ ├── btn_google_signin_light_normal_web.png
│ │ └── btn_google_signin_light_pressed_web.png
│ └── stylesheets
│ │ └── application.css
├── channels
│ └── application_cable
│ │ ├── channel.rb
│ │ └── connection.rb
├── controllers
│ ├── application_controller.rb
│ ├── concerns
│ │ └── .keep
│ ├── pages_controller.rb
│ └── users
│ │ ├── confirmations_controller.rb
│ │ ├── omniauth_callbacks_controller.rb
│ │ ├── passwords_controller.rb
│ │ ├── registrations_controller.rb
│ │ ├── sessions_controller.rb
│ │ └── unlocks_controller.rb
├── helpers
│ ├── application_helper.rb
│ └── pages_helper.rb
├── javascript
│ ├── application.js
│ └── controllers
│ │ ├── application.js
│ │ ├── hello_controller.js
│ │ └── index.js
├── jobs
│ └── application_job.rb
├── mailers
│ └── application_mailer.rb
├── models
│ ├── application_record.rb
│ ├── concerns
│ │ └── .keep
│ └── user.rb
└── views
│ ├── devise
│ ├── confirmations
│ │ └── new.html.erb
│ ├── mailer
│ │ ├── confirmation_instructions.html.erb
│ │ ├── email_changed.html.erb
│ │ ├── password_change.html.erb
│ │ ├── reset_password_instructions.html.erb
│ │ └── unlock_instructions.html.erb
│ ├── passwords
│ │ ├── edit.html.erb
│ │ └── new.html.erb
│ ├── registrations
│ │ ├── edit.html.erb
│ │ └── new.html.erb
│ ├── sessions
│ │ └── new.html.erb
│ ├── shared
│ │ ├── _error_messages.html.erb
│ │ └── _links.html.erb
│ └── unlocks
│ │ └── new.html.erb
│ ├── layouts
│ ├── application.html.erb
│ ├── mailer.html.erb
│ └── mailer.text.erb
│ └── pages
│ └── home.html.erb
├── bin
├── bundle
├── importmap
├── rails
├── rake
└── setup
├── config.ru
├── config
├── application.rb
├── boot.rb
├── cable.yml
├── credentials.yml.enc
├── database.yml
├── environment.rb
├── environments
│ ├── development.rb
│ ├── production.rb
│ └── test.rb
├── importmap.rb
├── initializers
│ ├── assets.rb
│ ├── content_security_policy.rb
│ ├── devise.rb
│ ├── filter_parameter_logging.rb
│ ├── inflections.rb
│ └── permissions_policy.rb
├── locales
│ ├── devise.en.yml
│ └── en.yml
├── puma.rb
├── routes.rb
└── storage.yml
├── db
├── migrate
│ └── 20220509071456_devise_create_users.rb
├── schema.rb
└── seeds.rb
├── lib
├── assets
│ └── .keep
└── tasks
│ └── .keep
├── log
└── .keep
├── public
├── 404.html
├── 422.html
├── 500.html
├── apple-touch-icon-precomposed.png
├── apple-touch-icon.png
├── favicon.ico
└── robots.txt
├── storage
└── .keep
├── test
├── application_system_test_case.rb
├── channels
│ └── application_cable
│ │ └── connection_test.rb
├── controllers
│ ├── .keep
│ └── pages_controller_test.rb
├── fixtures
│ ├── files
│ │ └── .keep
│ └── users.yml
├── helpers
│ └── .keep
├── integration
│ └── .keep
├── mailers
│ └── .keep
├── models
│ ├── .keep
│ └── user_test.rb
├── system
│ └── .keep
└── test_helper.rb
├── tmp
├── .keep
├── pids
│ └── .keep
└── storage
│ └── .keep
└── vendor
├── .keep
└── javascript
└── .keep
/.gitattributes:
--------------------------------------------------------------------------------
1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files.
2 |
3 | # Mark the database schema as having been generated.
4 | db/schema.rb linguist-generated
5 |
6 | # Mark any vendored files as having been vendored.
7 | vendor/* linguist-vendored
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2 | #
3 | # If you find yourself ignoring temporary files generated by your text editor
4 | # or operating system, you probably want to add a global ignore instead:
5 | # git config --global core.excludesfile '~/.gitignore_global'
6 |
7 | # Ignore bundler config.
8 | /.bundle
9 |
10 | # Ignore the default SQLite database.
11 | /db/*.sqlite3
12 | /db/*.sqlite3-*
13 |
14 | # Ignore all logfiles and tempfiles.
15 | /log/*
16 | /tmp/*
17 | !/log/.keep
18 | !/tmp/.keep
19 |
20 | # Ignore pidfiles, but keep the directory.
21 | /tmp/pids/*
22 | !/tmp/pids/
23 | !/tmp/pids/.keep
24 |
25 | # Ignore uploaded files in development.
26 | /storage/*
27 | !/storage/.keep
28 | /tmp/storage/*
29 | !/tmp/storage/
30 | !/tmp/storage/.keep
31 |
32 | /public/assets
33 |
34 | # Ignore master key for decrypting credentials and more.
35 | /config/master.key
36 |
--------------------------------------------------------------------------------
/.ruby-version:
--------------------------------------------------------------------------------
1 | ruby-3.1.0
2 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3 |
4 | ruby "3.1.0"
5 |
6 | # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
7 | gem "rails", "~> 7.0.2", ">= 7.0.2.4"
8 |
9 | # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
10 | gem "sprockets-rails"
11 |
12 | # Use sqlite3 as the database for Active Record
13 | gem "sqlite3", "~> 1.4"
14 |
15 | # Use the Puma web server [https://github.com/puma/puma]
16 | gem "puma", "~> 5.0"
17 |
18 | # Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
19 | gem "importmap-rails"
20 |
21 | # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
22 | gem "turbo-rails"
23 |
24 | # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
25 | gem "stimulus-rails"
26 |
27 | # Build JSON APIs with ease [https://github.com/rails/jbuilder]
28 | gem "jbuilder"
29 |
30 | # Use Redis adapter to run Action Cable in production
31 | gem "redis", "~> 4.0"
32 |
33 | # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
34 | # gem "kredis"
35 |
36 | # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
37 | # gem "bcrypt", "~> 3.1.7"
38 |
39 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
40 | gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
41 |
42 | # Reduces boot times through caching; required in config/boot.rb
43 | gem "bootsnap", require: false
44 |
45 | # Use Sass to process CSS
46 | # gem "sassc-rails"
47 |
48 | # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
49 | # gem "image_processing", "~> 1.2"
50 |
51 | group :development, :test do
52 | # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
53 | gem "debug", platforms: %i[ mri mingw x64_mingw ]
54 | end
55 |
56 | group :development do
57 | # Use console on exceptions pages [https://github.com/rails/web-console]
58 | gem "web-console"
59 |
60 | # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
61 | # gem "rack-mini-profiler"
62 |
63 | # Speed up commands on slow machines / big apps [https://github.com/rails/spring]
64 | # gem "spring"
65 | end
66 |
67 | group :test do
68 | # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
69 | gem "capybara"
70 | gem "selenium-webdriver"
71 | gem "webdrivers"
72 | end
73 |
74 |
75 | gem 'devise'
76 | gem 'omniauth'
77 | gem 'omniauth-google-oauth2'
78 | gem "omniauth-rails_csrf_protection", "~> 1.0"
--------------------------------------------------------------------------------
/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | actioncable (7.0.2.4)
5 | actionpack (= 7.0.2.4)
6 | activesupport (= 7.0.2.4)
7 | nio4r (~> 2.0)
8 | websocket-driver (>= 0.6.1)
9 | actionmailbox (7.0.2.4)
10 | actionpack (= 7.0.2.4)
11 | activejob (= 7.0.2.4)
12 | activerecord (= 7.0.2.4)
13 | activestorage (= 7.0.2.4)
14 | activesupport (= 7.0.2.4)
15 | mail (>= 2.7.1)
16 | net-imap
17 | net-pop
18 | net-smtp
19 | actionmailer (7.0.2.4)
20 | actionpack (= 7.0.2.4)
21 | actionview (= 7.0.2.4)
22 | activejob (= 7.0.2.4)
23 | activesupport (= 7.0.2.4)
24 | mail (~> 2.5, >= 2.5.4)
25 | net-imap
26 | net-pop
27 | net-smtp
28 | rails-dom-testing (~> 2.0)
29 | actionpack (7.0.2.4)
30 | actionview (= 7.0.2.4)
31 | activesupport (= 7.0.2.4)
32 | rack (~> 2.0, >= 2.2.0)
33 | rack-test (>= 0.6.3)
34 | rails-dom-testing (~> 2.0)
35 | rails-html-sanitizer (~> 1.0, >= 1.2.0)
36 | actiontext (7.0.2.4)
37 | actionpack (= 7.0.2.4)
38 | activerecord (= 7.0.2.4)
39 | activestorage (= 7.0.2.4)
40 | activesupport (= 7.0.2.4)
41 | globalid (>= 0.6.0)
42 | nokogiri (>= 1.8.5)
43 | actionview (7.0.2.4)
44 | activesupport (= 7.0.2.4)
45 | builder (~> 3.1)
46 | erubi (~> 1.4)
47 | rails-dom-testing (~> 2.0)
48 | rails-html-sanitizer (~> 1.1, >= 1.2.0)
49 | activejob (7.0.2.4)
50 | activesupport (= 7.0.2.4)
51 | globalid (>= 0.3.6)
52 | activemodel (7.0.2.4)
53 | activesupport (= 7.0.2.4)
54 | activerecord (7.0.2.4)
55 | activemodel (= 7.0.2.4)
56 | activesupport (= 7.0.2.4)
57 | activestorage (7.0.2.4)
58 | actionpack (= 7.0.2.4)
59 | activejob (= 7.0.2.4)
60 | activerecord (= 7.0.2.4)
61 | activesupport (= 7.0.2.4)
62 | marcel (~> 1.0)
63 | mini_mime (>= 1.1.0)
64 | activesupport (7.0.2.4)
65 | concurrent-ruby (~> 1.0, >= 1.0.2)
66 | i18n (>= 1.6, < 2)
67 | minitest (>= 5.1)
68 | tzinfo (~> 2.0)
69 | addressable (2.8.0)
70 | public_suffix (>= 2.0.2, < 5.0)
71 | bcrypt (3.1.17)
72 | bindex (0.8.1)
73 | bootsnap (1.11.1)
74 | msgpack (~> 1.2)
75 | builder (3.2.4)
76 | capybara (3.37.0)
77 | addressable
78 | matrix
79 | mini_mime (>= 0.1.3)
80 | nokogiri (~> 1.8)
81 | rack (>= 1.6.0)
82 | rack-test (>= 0.6.3)
83 | regexp_parser (>= 1.5, < 3.0)
84 | xpath (~> 3.2)
85 | childprocess (4.1.0)
86 | concurrent-ruby (1.1.10)
87 | crass (1.0.6)
88 | debug (1.5.0)
89 | irb (>= 1.3.6)
90 | reline (>= 0.2.7)
91 | devise (4.8.1)
92 | bcrypt (~> 3.0)
93 | orm_adapter (~> 0.1)
94 | railties (>= 4.1.0)
95 | responders
96 | warden (~> 1.2.3)
97 | digest (3.1.0)
98 | erubi (1.10.0)
99 | faraday (2.3.0)
100 | faraday-net_http (~> 2.0)
101 | ruby2_keywords (>= 0.0.4)
102 | faraday-net_http (2.0.2)
103 | globalid (1.0.0)
104 | activesupport (>= 5.0)
105 | hashie (5.0.0)
106 | i18n (1.10.0)
107 | concurrent-ruby (~> 1.0)
108 | importmap-rails (1.0.3)
109 | actionpack (>= 6.0.0)
110 | railties (>= 6.0.0)
111 | io-console (0.5.11)
112 | irb (1.4.1)
113 | reline (>= 0.3.0)
114 | jbuilder (2.11.5)
115 | actionview (>= 5.0.0)
116 | activesupport (>= 5.0.0)
117 | jwt (2.3.0)
118 | loofah (2.17.0)
119 | crass (~> 1.0.2)
120 | nokogiri (>= 1.5.9)
121 | mail (2.7.1)
122 | mini_mime (>= 0.1.1)
123 | marcel (1.0.2)
124 | matrix (0.4.2)
125 | method_source (1.0.0)
126 | mini_mime (1.1.2)
127 | minitest (5.15.0)
128 | msgpack (1.5.1)
129 | multi_json (1.15.0)
130 | multi_xml (0.6.0)
131 | net-imap (0.2.3)
132 | digest
133 | net-protocol
134 | strscan
135 | net-pop (0.1.1)
136 | digest
137 | net-protocol
138 | timeout
139 | net-protocol (0.1.3)
140 | timeout
141 | net-smtp (0.3.1)
142 | digest
143 | net-protocol
144 | timeout
145 | nio4r (2.5.8)
146 | nokogiri (1.13.6-x86_64-linux)
147 | racc (~> 1.4)
148 | oauth2 (1.4.9)
149 | faraday (>= 0.17.3, < 3.0)
150 | jwt (>= 1.0, < 3.0)
151 | multi_json (~> 1.3)
152 | multi_xml (~> 0.5)
153 | rack (>= 1.2, < 3)
154 | omniauth (2.1.0)
155 | hashie (>= 3.4.6)
156 | rack (>= 2.2.3)
157 | rack-protection
158 | omniauth-google-oauth2 (1.0.1)
159 | jwt (>= 2.0)
160 | oauth2 (~> 1.1)
161 | omniauth (~> 2.0)
162 | omniauth-oauth2 (~> 1.7.1)
163 | omniauth-oauth2 (1.7.2)
164 | oauth2 (~> 1.4)
165 | omniauth (>= 1.9, < 3)
166 | omniauth-rails_csrf_protection (1.0.1)
167 | actionpack (>= 4.2)
168 | omniauth (~> 2.0)
169 | orm_adapter (0.5.0)
170 | public_suffix (4.0.7)
171 | puma (5.6.4)
172 | nio4r (~> 2.0)
173 | racc (1.6.0)
174 | rack (2.2.3)
175 | rack-protection (2.2.0)
176 | rack
177 | rack-test (1.1.0)
178 | rack (>= 1.0, < 3)
179 | rails (7.0.2.4)
180 | actioncable (= 7.0.2.4)
181 | actionmailbox (= 7.0.2.4)
182 | actionmailer (= 7.0.2.4)
183 | actionpack (= 7.0.2.4)
184 | actiontext (= 7.0.2.4)
185 | actionview (= 7.0.2.4)
186 | activejob (= 7.0.2.4)
187 | activemodel (= 7.0.2.4)
188 | activerecord (= 7.0.2.4)
189 | activestorage (= 7.0.2.4)
190 | activesupport (= 7.0.2.4)
191 | bundler (>= 1.15.0)
192 | railties (= 7.0.2.4)
193 | rails-dom-testing (2.0.3)
194 | activesupport (>= 4.2.0)
195 | nokogiri (>= 1.6)
196 | rails-html-sanitizer (1.4.2)
197 | loofah (~> 2.3)
198 | railties (7.0.2.4)
199 | actionpack (= 7.0.2.4)
200 | activesupport (= 7.0.2.4)
201 | method_source
202 | rake (>= 12.2)
203 | thor (~> 1.0)
204 | zeitwerk (~> 2.5)
205 | rake (13.0.6)
206 | redis (4.6.0)
207 | regexp_parser (2.3.1)
208 | reline (0.3.1)
209 | io-console (~> 0.5)
210 | responders (3.0.1)
211 | actionpack (>= 5.0)
212 | railties (>= 5.0)
213 | rexml (3.2.5)
214 | ruby2_keywords (0.0.5)
215 | rubyzip (2.3.2)
216 | selenium-webdriver (4.1.0)
217 | childprocess (>= 0.5, < 5.0)
218 | rexml (~> 3.2, >= 3.2.5)
219 | rubyzip (>= 1.2.2)
220 | sprockets (4.0.3)
221 | concurrent-ruby (~> 1.0)
222 | rack (> 1, < 3)
223 | sprockets-rails (3.4.2)
224 | actionpack (>= 5.2)
225 | activesupport (>= 5.2)
226 | sprockets (>= 3.0.0)
227 | sqlite3 (1.4.2)
228 | stimulus-rails (1.0.4)
229 | railties (>= 6.0.0)
230 | strscan (3.0.1)
231 | thor (1.2.1)
232 | timeout (0.2.0)
233 | turbo-rails (1.0.1)
234 | actionpack (>= 6.0.0)
235 | railties (>= 6.0.0)
236 | tzinfo (2.0.4)
237 | concurrent-ruby (~> 1.0)
238 | warden (1.2.9)
239 | rack (>= 2.0.9)
240 | web-console (4.2.0)
241 | actionview (>= 6.0.0)
242 | activemodel (>= 6.0.0)
243 | bindex (>= 0.4.0)
244 | railties (>= 6.0.0)
245 | webdrivers (5.0.0)
246 | nokogiri (~> 1.6)
247 | rubyzip (>= 1.3.0)
248 | selenium-webdriver (~> 4.0)
249 | websocket-driver (0.7.5)
250 | websocket-extensions (>= 0.1.0)
251 | websocket-extensions (0.1.5)
252 | xpath (3.2.0)
253 | nokogiri (~> 1.8)
254 | zeitwerk (2.5.4)
255 |
256 | PLATFORMS
257 | x86_64-linux
258 |
259 | DEPENDENCIES
260 | bootsnap
261 | capybara
262 | debug
263 | devise
264 | importmap-rails
265 | jbuilder
266 | omniauth
267 | omniauth-google-oauth2
268 | omniauth-rails_csrf_protection (~> 1.0)
269 | puma (~> 5.0)
270 | rails (~> 7.0.2, >= 7.0.2.4)
271 | redis (~> 4.0)
272 | selenium-webdriver
273 | sprockets-rails
274 | sqlite3 (~> 1.4)
275 | stimulus-rails
276 | turbo-rails
277 | tzinfo-data
278 | web-console
279 | webdrivers
280 |
281 | RUBY VERSION
282 | ruby 3.1.0p0
283 |
284 | BUNDLED WITH
285 | 2.3.10
286 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # README
2 |
3 | This README would normally document whatever steps are necessary to get the
4 | application up and running.
5 |
6 | Things you may want to cover:
7 |
8 | * Ruby version
9 |
10 | * System dependencies
11 |
12 | * Configuration
13 |
14 | * Database creation
15 |
16 | * Database initialization
17 |
18 | * How to run the test suite
19 |
20 | * Services (job queues, cache servers, search engines, etc.)
21 |
22 | * Deployment instructions
23 |
24 | * ...
25 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require_relative "config/application"
5 |
6 | Rails.application.load_tasks
7 |
--------------------------------------------------------------------------------
/app/assets/config/manifest.js:
--------------------------------------------------------------------------------
1 | //= link_tree ../images
2 | //= link_directory ../stylesheets .css
3 | //= link_tree ../../javascript .js
4 | //= link_tree ../../../vendor/javascript .js
5 |
--------------------------------------------------------------------------------
/app/assets/images/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/app/assets/images/.keep
--------------------------------------------------------------------------------
/app/assets/images/btn_google_signin_dark_disabled_web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/app/assets/images/btn_google_signin_dark_disabled_web.png
--------------------------------------------------------------------------------
/app/assets/images/btn_google_signin_dark_focus_web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/app/assets/images/btn_google_signin_dark_focus_web.png
--------------------------------------------------------------------------------
/app/assets/images/btn_google_signin_dark_normal_web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/app/assets/images/btn_google_signin_dark_normal_web.png
--------------------------------------------------------------------------------
/app/assets/images/btn_google_signin_dark_pressed_web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/app/assets/images/btn_google_signin_dark_pressed_web.png
--------------------------------------------------------------------------------
/app/assets/images/btn_google_signin_light_disabled_web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/app/assets/images/btn_google_signin_light_disabled_web.png
--------------------------------------------------------------------------------
/app/assets/images/btn_google_signin_light_focus_web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/app/assets/images/btn_google_signin_light_focus_web.png
--------------------------------------------------------------------------------
/app/assets/images/btn_google_signin_light_normal_web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/app/assets/images/btn_google_signin_light_normal_web.png
--------------------------------------------------------------------------------
/app/assets/images/btn_google_signin_light_pressed_web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/app/assets/images/btn_google_signin_light_pressed_web.png
--------------------------------------------------------------------------------
/app/assets/stylesheets/application.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This is a manifest file that'll be compiled into application.css, which will include all the files
3 | * listed below.
4 | *
5 | * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
6 | * vendor/assets/stylesheets directory can be referenced here using a relative path.
7 | *
8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9 | * compiled file so the styles you add here take precedence over styles defined in any other CSS
10 | * files in this directory. Styles in this file should be added after the last require_* statement.
11 | * It is generally better to create a new file per style scope.
12 | *
13 | *= require_tree .
14 | *= require_self
15 | */
16 |
--------------------------------------------------------------------------------
/app/channels/application_cable/channel.rb:
--------------------------------------------------------------------------------
1 | module ApplicationCable
2 | class Channel < ActionCable::Channel::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/app/channels/application_cable/connection.rb:
--------------------------------------------------------------------------------
1 | module ApplicationCable
2 | class Connection < ActionCable::Connection::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | end
3 |
--------------------------------------------------------------------------------
/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/app/controllers/concerns/.keep
--------------------------------------------------------------------------------
/app/controllers/pages_controller.rb:
--------------------------------------------------------------------------------
1 | class PagesController < ApplicationController
2 | def home
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/app/controllers/users/confirmations_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class Users::ConfirmationsController < Devise::ConfirmationsController
4 | # GET /resource/confirmation/new
5 | # def new
6 | # super
7 | # end
8 |
9 | # POST /resource/confirmation
10 | # def create
11 | # super
12 | # end
13 |
14 | # GET /resource/confirmation?confirmation_token=abcdef
15 | # def show
16 | # super
17 | # end
18 |
19 | # protected
20 |
21 | # The path used after resending confirmation instructions.
22 | # def after_resending_confirmation_instructions_path_for(resource_name)
23 | # super(resource_name)
24 | # end
25 |
26 | # The path used after confirmation.
27 | # def after_confirmation_path_for(resource_name, resource)
28 | # super(resource_name, resource)
29 | # end
30 | end
31 |
--------------------------------------------------------------------------------
/app/controllers/users/omniauth_callbacks_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
4 | # You should configure your model like this:
5 | # devise :omniauthable, omniauth_providers: [:twitter]
6 |
7 | # You should also create an action method in this controller like this:
8 | # def twitter
9 | # end
10 |
11 | def google_oauth2
12 | user = User.from_omniauth(auth)
13 |
14 | if user.present?
15 | sign_out_all_scopes
16 | flash[:success] = t 'devise.omniauth_callbacks.success', kind: 'Google'
17 | sign_in_and_redirect user, event: :authentication
18 | else
19 | flash[:alert] =
20 | t 'devise.omniauth_callbacks.failure', kind: 'Google', reason: "#{auth.info.email} is not authorized."
21 | redirect_to new_user_session_path
22 | end
23 | end
24 |
25 | # More info at:
26 | # https://github.com/heartcombo/devise#omniauth
27 |
28 | # GET|POST /resource/auth/twitter
29 | # def passthru
30 | # super
31 | # end
32 |
33 | # GET|POST /users/auth/twitter/callback
34 | # def failure
35 | # super
36 | # end
37 |
38 | # protected
39 |
40 | # The path used when OmniAuth fails
41 | # def after_omniauth_failure_path_for(scope)
42 | # super(scope)
43 | # end
44 |
45 | protected
46 |
47 | def after_omniauth_failure_path_for(_scope)
48 | new_user_session_path
49 | end
50 |
51 | def after_sign_in_path_for(resource_or_scope)
52 | stored_location_for(resource_or_scope) || root_path
53 | end
54 |
55 | private
56 |
57 | # def from_google_params
58 | # @from_google_params ||= {
59 | # uid: auth.uid,
60 | # email: auth.info.email,
61 | # full_name: auth.info.name,
62 | # avatar_url: auth.info.image
63 | # }
64 | # end
65 |
66 | def auth
67 | @auth ||= request.env['omniauth.auth']
68 | end
69 | end
70 |
--------------------------------------------------------------------------------
/app/controllers/users/passwords_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class Users::PasswordsController < Devise::PasswordsController
4 | # GET /resource/password/new
5 | # def new
6 | # super
7 | # end
8 |
9 | # POST /resource/password
10 | # def create
11 | # super
12 | # end
13 |
14 | # GET /resource/password/edit?reset_password_token=abcdef
15 | # def edit
16 | # super
17 | # end
18 |
19 | # PUT /resource/password
20 | # def update
21 | # super
22 | # end
23 |
24 | # protected
25 |
26 | # def after_resetting_password_path_for(resource)
27 | # super(resource)
28 | # end
29 |
30 | # The path used after sending reset password instructions
31 | # def after_sending_reset_password_instructions_path_for(resource_name)
32 | # super(resource_name)
33 | # end
34 | end
35 |
--------------------------------------------------------------------------------
/app/controllers/users/registrations_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class Users::RegistrationsController < Devise::RegistrationsController
4 | # before_action :configure_sign_up_params, only: [:create]
5 | # before_action :configure_account_update_params, only: [:update]
6 |
7 | # GET /resource/sign_up
8 | # def new
9 | # super
10 | # end
11 |
12 | # POST /resource
13 | # def create
14 | # super
15 | # end
16 |
17 | # GET /resource/edit
18 | # def edit
19 | # super
20 | # end
21 |
22 | # PUT /resource
23 | # def update
24 | # super
25 | # end
26 |
27 | # DELETE /resource
28 | # def destroy
29 | # super
30 | # end
31 |
32 | def update_resource(resource, params)
33 | if resource.provider == 'google_oauth2'
34 | params.delete('current_password')
35 | resource.password = params['password']
36 |
37 | resource.update_without_password(params)
38 | else
39 | resource.update_with_password(params)
40 | end
41 | end
42 |
43 | # GET /resource/cancel
44 | # Forces the session data which is usually expired after sign
45 | # in to be expired now. This is useful if the user wants to
46 | # cancel oauth signing in/up in the middle of the process,
47 | # removing all OAuth session data.
48 | # def cancel
49 | # super
50 | # end
51 |
52 | # If you have extra params to permit, append them to the sanitizer.
53 | # def configure_sign_up_params
54 | # devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])
55 | # end
56 |
57 | # If you have extra params to permit, append them to the sanitizer.
58 | # def configure_account_update_params
59 | # devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])
60 | # end
61 |
62 | # The path used after sign up.
63 | # def after_sign_up_path_for(resource)
64 | # super(resource)
65 | # end
66 |
67 | # The path used after sign up for inactive accounts.
68 | # def after_inactive_sign_up_path_for(resource)
69 | # super(resource)
70 | # end
71 | end
72 |
--------------------------------------------------------------------------------
/app/controllers/users/sessions_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class Users::SessionsController < Devise::SessionsController
4 | # before_action :configure_sign_in_params, only: [:create]
5 |
6 | # GET /resource/sign_in
7 | # def new
8 | # super
9 | # end
10 |
11 | # POST /resource/sign_in
12 | # def create
13 | # super
14 | # end
15 |
16 | # DELETE /resource/sign_out
17 | # def destroy
18 | # super
19 | # end
20 |
21 | def after_sign_out_path_for(_resource_or_scope)
22 | new_user_session_path
23 | end
24 |
25 | def after_sign_in_path_for(resource_or_scope)
26 | stored_location_for(resource_or_scope) || root_path
27 | end
28 | # protected
29 |
30 | # If you have extra params to permit, append them to the sanitizer.
31 | # def configure_sign_in_params
32 | # devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
33 | # end
34 | end
35 |
--------------------------------------------------------------------------------
/app/controllers/users/unlocks_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class Users::UnlocksController < Devise::UnlocksController
4 | # GET /resource/unlock/new
5 | # def new
6 | # super
7 | # end
8 |
9 | # POST /resource/unlock
10 | # def create
11 | # super
12 | # end
13 |
14 | # GET /resource/unlock?unlock_token=abcdef
15 | # def show
16 | # super
17 | # end
18 |
19 | # protected
20 |
21 | # The path used after sending unlock password instructions
22 | # def after_sending_unlock_instructions_path_for(resource)
23 | # super(resource)
24 | # end
25 |
26 | # The path used after unlocking the resource
27 | # def after_unlock_path_for(resource)
28 | # super(resource)
29 | # end
30 | end
31 |
--------------------------------------------------------------------------------
/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/pages_helper.rb:
--------------------------------------------------------------------------------
1 | module PagesHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/javascript/application.js:
--------------------------------------------------------------------------------
1 | // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2 | import "@hotwired/turbo-rails"
3 | import "controllers"
4 |
--------------------------------------------------------------------------------
/app/javascript/controllers/application.js:
--------------------------------------------------------------------------------
1 | import { Application } from "@hotwired/stimulus"
2 |
3 | const application = Application.start()
4 |
5 | // Configure Stimulus development experience
6 | application.debug = false
7 | window.Stimulus = application
8 |
9 | export { application }
10 |
--------------------------------------------------------------------------------
/app/javascript/controllers/hello_controller.js:
--------------------------------------------------------------------------------
1 | import { Controller } from "@hotwired/stimulus"
2 |
3 | export default class extends Controller {
4 | connect() {
5 | this.element.textContent = "Hello World!"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/app/javascript/controllers/index.js:
--------------------------------------------------------------------------------
1 | // Import and register all your controllers from the importmap under controllers/*
2 |
3 | import { application } from "controllers/application"
4 |
5 | // Eager load all controllers defined in the import map under controllers/**/*_controller
6 | import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
7 | eagerLoadControllersFrom("controllers", application)
8 |
9 | // Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!)
10 | // import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading"
11 | // lazyLoadControllersFrom("controllers", application)
12 |
--------------------------------------------------------------------------------
/app/jobs/application_job.rb:
--------------------------------------------------------------------------------
1 | class ApplicationJob < ActiveJob::Base
2 | # Automatically retry jobs that encountered a deadlock
3 | # retry_on ActiveRecord::Deadlocked
4 |
5 | # Most jobs are safe to ignore if the underlying records are no longer available
6 | # discard_on ActiveJob::DeserializationError
7 | end
8 |
--------------------------------------------------------------------------------
/app/mailers/application_mailer.rb:
--------------------------------------------------------------------------------
1 | class ApplicationMailer < ActionMailer::Base
2 | default from: "from@example.com"
3 | layout "mailer"
4 | end
5 |
--------------------------------------------------------------------------------
/app/models/application_record.rb:
--------------------------------------------------------------------------------
1 | class ApplicationRecord < ActiveRecord::Base
2 | primary_abstract_class
3 | end
4 |
--------------------------------------------------------------------------------
/app/models/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/app/models/concerns/.keep
--------------------------------------------------------------------------------
/app/models/user.rb:
--------------------------------------------------------------------------------
1 | class User < ApplicationRecord
2 | # Include default devise modules. Others available are:
3 | # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
4 | devise :omniauthable, :database_authenticatable, :registerable,
5 | :recoverable, :rememberable, :validatable, omniauth_providers: [:google_oauth2]
6 |
7 | def self.from_omniauth(auth)
8 | where(provider: auth.provider, uid: auth.uid).first_or_create do |user|
9 | user.email = auth.info.email
10 | user.password = Devise.friendly_token[0, 20]
11 | user.full_name = auth.info.name # assuming the user model has a name
12 | user.avatar_url = auth.info.image # assuming the user model has an image
13 | # If you are using confirmable and the provider(s) you use validate emails,
14 | # uncomment the line below to skip the confirmation emails.
15 | # user.skip_confirmation!
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/app/views/devise/confirmations/new.html.erb:
--------------------------------------------------------------------------------
1 |
Resend confirmation instructions
2 |
3 | <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= render "devise/shared/error_messages", resource: resource %>
5 |
6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
9 |
10 |
11 |
12 | <%= f.submit "Resend confirmation instructions" %>
13 |
14 | <% end %>
15 |
16 | <%= render "devise/shared/links" %>
17 |
--------------------------------------------------------------------------------
/app/views/devise/mailer/confirmation_instructions.html.erb:
--------------------------------------------------------------------------------
1 | Welcome <%= @email %>!
2 |
3 | You can confirm your account email through the link below:
4 |
5 | <%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>
6 |
--------------------------------------------------------------------------------
/app/views/devise/mailer/email_changed.html.erb:
--------------------------------------------------------------------------------
1 | Hello <%= @email %>!
2 |
3 | <% if @resource.try(:unconfirmed_email?) %>
4 | We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.
5 | <% else %>
6 | We're contacting you to notify you that your email has been changed to <%= @resource.email %>.
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/app/views/devise/mailer/password_change.html.erb:
--------------------------------------------------------------------------------
1 | Hello <%= @resource.email %>!
2 |
3 | We're contacting you to notify you that your password has been changed.
4 |
--------------------------------------------------------------------------------
/app/views/devise/mailer/reset_password_instructions.html.erb:
--------------------------------------------------------------------------------
1 | Hello <%= @resource.email %>!
2 |
3 | Someone has requested a link to change your password. You can do this through the link below.
4 |
5 | <%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>
6 |
7 | If you didn't request this, please ignore this email.
8 | Your password won't change until you access the link above and create a new one.
9 |
--------------------------------------------------------------------------------
/app/views/devise/mailer/unlock_instructions.html.erb:
--------------------------------------------------------------------------------
1 | Hello <%= @resource.email %>!
2 |
3 | Your account has been locked due to an excessive number of unsuccessful sign in attempts.
4 |
5 | Click the link below to unlock your account:
6 |
7 | <%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>
8 |
--------------------------------------------------------------------------------
/app/views/devise/passwords/edit.html.erb:
--------------------------------------------------------------------------------
1 | Change your password
2 |
3 | <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
4 | <%= render "devise/shared/error_messages", resource: resource %>
5 | <%= f.hidden_field :reset_password_token %>
6 |
7 |
8 | <%= f.label :password, "New password" %>
9 | <% if @minimum_password_length %>
10 | (<%= @minimum_password_length %> characters minimum)
11 | <% end %>
12 | <%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
13 |
14 |
15 |
16 | <%= f.label :password_confirmation, "Confirm new password" %>
17 | <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
18 |
19 |
20 |
21 | <%= f.submit "Change my password" %>
22 |
23 | <% end %>
24 |
25 | <%= render "devise/shared/links" %>
26 |
--------------------------------------------------------------------------------
/app/views/devise/passwords/new.html.erb:
--------------------------------------------------------------------------------
1 | Forgot your password?
2 |
3 | <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= render "devise/shared/error_messages", resource: resource %>
5 |
6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
9 |
10 |
11 |
12 | <%= f.submit "Send me reset password instructions" %>
13 |
14 | <% end %>
15 |
16 | <%= render "devise/shared/links" %>
17 |
--------------------------------------------------------------------------------
/app/views/devise/registrations/edit.html.erb:
--------------------------------------------------------------------------------
1 | Edit <%= resource_name.to_s.humanize %>
2 |
3 | <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }, data: {turbo: "false"}) do |f| %>
4 | <%= render "devise/shared/error_messages", resource: resource %>
5 |
6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
9 |
10 |
11 | <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
12 | Currently waiting confirmation for: <%= resource.unconfirmed_email %>
13 | <% end %>
14 |
15 |
16 | <%= f.label :password %> (leave blank if you don't want to change it)
17 | <%= f.password_field :password, autocomplete: "new-password" %>
18 | <% if @minimum_password_length %>
19 |
20 | <%= @minimum_password_length %> characters minimum
21 | <% end %>
22 |
23 |
24 |
25 | <%= f.label :password_confirmation %>
26 | <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
27 |
28 |
29 |
30 | <%= f.label :current_password %> (we need your current password to confirm your changes)
31 | <%= f.password_field :current_password, autocomplete: "current-password" %>
32 |
33 |
34 |
35 | <%= f.submit "Update" %>
36 |
37 | <% end %>
38 |
39 | Cancel my account
40 |
41 | Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>
42 |
43 | <%= link_to "Back", :back %>
44 |
--------------------------------------------------------------------------------
/app/views/devise/registrations/new.html.erb:
--------------------------------------------------------------------------------
1 | Sign up
2 |
3 | <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
4 | <%= render "devise/shared/error_messages", resource: resource %>
5 |
6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
9 |
10 |
11 |
12 | <%= f.label :password %>
13 | <% if @minimum_password_length %>
14 | (<%= @minimum_password_length %> characters minimum)
15 | <% end %>
16 | <%= f.password_field :password, autocomplete: "new-password" %>
17 |
18 |
19 |
20 | <%= f.label :password_confirmation %>
21 | <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
22 |
23 |
24 |
25 | <%= f.submit "Sign up" %>
26 |
27 | <% end %>
28 |
29 | <%= render "devise/shared/links" %>
30 |
--------------------------------------------------------------------------------
/app/views/devise/sessions/new.html.erb:
--------------------------------------------------------------------------------
1 | Log in
2 |
3 | <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
4 |
5 | <%= f.label :email %>
6 | <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
7 |
8 |
9 |
10 | <%= f.label :password %>
11 | <%= f.password_field :password, autocomplete: "current-password" %>
12 |
13 |
14 | <% if devise_mapping.rememberable? %>
15 |
16 | <%= f.check_box :remember_me %>
17 | <%= f.label :remember_me %>
18 |
19 | <% end %>
20 |
21 |
22 | <%= f.submit "Log in" %>
23 |
24 | <% end %>
25 |
26 | <%= render "devise/shared/links" %>
27 |
--------------------------------------------------------------------------------
/app/views/devise/shared/_error_messages.html.erb:
--------------------------------------------------------------------------------
1 | <% if resource.errors.any? %>
2 |
3 |
4 | <%= I18n.t("errors.messages.not_saved",
5 | count: resource.errors.count,
6 | resource: resource.class.model_name.human.downcase)
7 | %>
8 |
9 |
10 | <% resource.errors.full_messages.each do |message| %>
11 | - <%= message %>
12 | <% end %>
13 |
14 |
15 | <% end %>
16 |
--------------------------------------------------------------------------------
/app/views/devise/shared/_links.html.erb:
--------------------------------------------------------------------------------
1 | <%- if controller_name != 'sessions' %>
2 | <%= link_to "Log in", new_session_path(resource_name) %>
3 | <% end %>
4 |
5 | <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6 | <%= link_to "Sign up", new_registration_path(resource_name) %>
7 | <% end %>
8 |
9 | <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
10 | <%= link_to "Forgot your password?", new_password_path(resource_name) %>
11 | <% end %>
12 |
13 | <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14 | <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
15 | <% end %>
16 |
17 | <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18 | <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
19 | <% end %>
20 |
21 | <%- if devise_mapping.omniauthable? %>
22 | <%- resource_class.omniauth_providers.each do |provider| %>
23 | <%= form_for "Login",
24 | url: omniauth_authorize_path(resource_name, provider),
25 | method: :post,
26 | data: {turbo: "false"} do |f| %>
27 | <%= f.submit "Login", type: "image", src: url_for("/assets/btn_google_signin_light_normal_web.png") %>
28 | <% end %>
29 | <% end %>
30 | <% end %>
31 |
--------------------------------------------------------------------------------
/app/views/devise/unlocks/new.html.erb:
--------------------------------------------------------------------------------
1 | Resend unlock instructions
2 |
3 | <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= render "devise/shared/error_messages", resource: resource %>
5 |
6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
9 |
10 |
11 |
12 | <%= f.submit "Resend unlock instructions" %>
13 |
14 | <% end %>
15 |
16 | <%= render "devise/shared/links" %>
17 |
--------------------------------------------------------------------------------
/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OmniAuthGoogle
5 |
6 | <%= csrf_meta_tags %>
7 | <%= csp_meta_tag %>
8 |
9 | <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
10 | <%= javascript_importmap_tags %>
11 |
12 |
17 |
18 |
19 |
20 | <% if flash.any? %>
21 | <% flash.each do |key, value| -%>
22 |
23 | <% end -%>
24 | <% end %>
25 | <%= yield %>
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/views/layouts/mailer.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 | <%= yield %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/views/layouts/mailer.text.erb:
--------------------------------------------------------------------------------
1 | <%= yield %>
2 |
--------------------------------------------------------------------------------
/app/views/pages/home.html.erb:
--------------------------------------------------------------------------------
1 | Pages#home
2 | Find me in app/views/pages/home.html.erb
3 |
4 | <% if current_user %>
5 | <%= current_user.email %>
6 | <%= image_tag(current_user.avatar_url) %>
7 | <%= link_to "Edit Account", edit_user_registration_path %>
8 | <%= button_to "Logout", destroy_user_session_path, data: {turbo: "false"}, method: :delete %>
9 | <% else %>
10 | <%= link_to "Login", new_user_session_path %>
11 | <%= link_to "Create Account", new_user_registration_path %>
12 | <% end %>
--------------------------------------------------------------------------------
/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # frozen_string_literal: true
3 |
4 | #
5 | # This file was generated by Bundler.
6 | #
7 | # The application 'bundle' is installed as part of a gem, and
8 | # this file is here to facilitate running it.
9 | #
10 |
11 | require "rubygems"
12 |
13 | m = Module.new do
14 | module_function
15 |
16 | def invoked_as_script?
17 | File.expand_path($0) == File.expand_path(__FILE__)
18 | end
19 |
20 | def env_var_version
21 | ENV["BUNDLER_VERSION"]
22 | end
23 |
24 | def cli_arg_version
25 | return unless invoked_as_script? # don't want to hijack other binstubs
26 | return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
27 | bundler_version = nil
28 | update_index = nil
29 | ARGV.each_with_index do |a, i|
30 | if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
31 | bundler_version = a
32 | end
33 | next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
34 | bundler_version = $1
35 | update_index = i
36 | end
37 | bundler_version
38 | end
39 |
40 | def gemfile
41 | gemfile = ENV["BUNDLE_GEMFILE"]
42 | return gemfile if gemfile && !gemfile.empty?
43 |
44 | File.expand_path("../../Gemfile", __FILE__)
45 | end
46 |
47 | def lockfile
48 | lockfile =
49 | case File.basename(gemfile)
50 | when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
51 | else "#{gemfile}.lock"
52 | end
53 | File.expand_path(lockfile)
54 | end
55 |
56 | def lockfile_version
57 | return unless File.file?(lockfile)
58 | lockfile_contents = File.read(lockfile)
59 | return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
60 | Regexp.last_match(1)
61 | end
62 |
63 | def bundler_requirement
64 | @bundler_requirement ||=
65 | env_var_version || cli_arg_version ||
66 | bundler_requirement_for(lockfile_version)
67 | end
68 |
69 | def bundler_requirement_for(version)
70 | return "#{Gem::Requirement.default}.a" unless version
71 |
72 | bundler_gem_version = Gem::Version.new(version)
73 |
74 | requirement = bundler_gem_version.approximate_recommendation
75 |
76 | return requirement unless Gem.rubygems_version < Gem::Version.new("2.7.0")
77 |
78 | requirement += ".a" if bundler_gem_version.prerelease?
79 |
80 | requirement
81 | end
82 |
83 | def load_bundler!
84 | ENV["BUNDLE_GEMFILE"] ||= gemfile
85 |
86 | activate_bundler
87 | end
88 |
89 | def activate_bundler
90 | gem_error = activation_error_handling do
91 | gem "bundler", bundler_requirement
92 | end
93 | return if gem_error.nil?
94 | require_error = activation_error_handling do
95 | require "bundler/version"
96 | end
97 | return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
98 | warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
99 | exit 42
100 | end
101 |
102 | def activation_error_handling
103 | yield
104 | nil
105 | rescue StandardError, LoadError => e
106 | e
107 | end
108 | end
109 |
110 | m.load_bundler!
111 |
112 | if m.invoked_as_script?
113 | load Gem.bin_path("bundler", "bundle")
114 | end
115 |
--------------------------------------------------------------------------------
/bin/importmap:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | require_relative "../config/application"
4 | require "importmap/commands"
5 |
--------------------------------------------------------------------------------
/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path("../config/application", __dir__)
3 | require_relative "../config/boot"
4 | require "rails/commands"
5 |
--------------------------------------------------------------------------------
/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative "../config/boot"
3 | require "rake"
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/bin/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require "fileutils"
3 |
4 | # path to your application root.
5 | APP_ROOT = File.expand_path("..", __dir__)
6 |
7 | def system!(*args)
8 | system(*args) || abort("\n== Command #{args} failed ==")
9 | end
10 |
11 | FileUtils.chdir APP_ROOT do
12 | # This script is a way to set up or update your development environment automatically.
13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome.
14 | # Add necessary setup steps to this file.
15 |
16 | puts "== Installing dependencies =="
17 | system! "gem install bundler --conservative"
18 | system("bundle check") || system!("bundle install")
19 |
20 | # puts "\n== Copying sample files =="
21 | # unless File.exist?("config/database.yml")
22 | # FileUtils.cp "config/database.yml.sample", "config/database.yml"
23 | # end
24 |
25 | puts "\n== Preparing database =="
26 | system! "bin/rails db:prepare"
27 |
28 | puts "\n== Removing old logs and tempfiles =="
29 | system! "bin/rails log:clear tmp:clear"
30 |
31 | puts "\n== Restarting application server =="
32 | system! "bin/rails restart"
33 | end
34 |
--------------------------------------------------------------------------------
/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require_relative "config/environment"
4 |
5 | run Rails.application
6 | Rails.application.load_server
7 |
--------------------------------------------------------------------------------
/config/application.rb:
--------------------------------------------------------------------------------
1 | require_relative "boot"
2 |
3 | require "rails/all"
4 |
5 | # Require the gems listed in Gemfile, including any gems
6 | # you've limited to :test, :development, or :production.
7 | Bundler.require(*Rails.groups)
8 |
9 | module OmniAuthGoogle
10 | class Application < Rails::Application
11 | # Initialize configuration defaults for originally generated Rails version.
12 | config.load_defaults 7.0
13 |
14 | # Configuration for the application, engines, and railties goes here.
15 | #
16 | # These settings can be overridden in specific environments using the files
17 | # in config/environments, which are processed later.
18 | #
19 | # config.time_zone = "Central Time (US & Canada)"
20 | # config.eager_load_paths << Rails.root.join("extras")
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/config/boot.rb:
--------------------------------------------------------------------------------
1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2 |
3 | require "bundler/setup" # Set up gems listed in the Gemfile.
4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations.
5 |
--------------------------------------------------------------------------------
/config/cable.yml:
--------------------------------------------------------------------------------
1 | development:
2 | adapter: redis
3 | url: redis://localhost:6379/1
4 |
5 | test:
6 | adapter: test
7 |
8 | production:
9 | adapter: redis
10 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
11 | channel_prefix: omni_auth_google_production
12 |
--------------------------------------------------------------------------------
/config/credentials.yml.enc:
--------------------------------------------------------------------------------
1 | YoFnCLBxQCHvPg4sPV4GfeKUxTtz7JgDLdUrMMqyy7YKGGIYJQUSYyz3hTbkluClGUxAdLm4mIOeBVOFwbK8MSFJwAsyY8WsxyzBchMZtm3XHDEt1FawYwSb0+xmfpOEj6whMQrlg78NkA+eyNbk7si41SVD3AJUzHXPX4IWmaL9KOUucWJkHAmwIocCBTxtGZuj9vaeb32gYAY8FpelKIpbVBrKXIZpkT19kTLTmY7GZZH8/5HWUxPCL5Iv/jyhqS1z8vARbeYu4YGvJf/VlYnxYQVq73Y3s7WF6jrk07Wg7ydWEMwzqNM/HcRCeeS30eZKjuGrMfK5+e2Cl4Fh413lUTLxIa5MFTSiKQ1/vLXCxbADCKW69oGd5oayDI63v0n2V56vW347NF0aXJ1enITrQJ/cPmXtHxW7leWjuMbTWXqYI+3EPsvjO4BpQ8Wd/RPXUMDhvYKP2Pq9YiwSJv/L4Ybmeps3nBlAliUOKl/Tgdnrjk3gWeo+UGjO+jUqaE/Z0c2GqdFwRuAUar9+CWed701TM79CEPqtVkUU34YhdRLMUoKlxI4lj6PqW/h6nYzu4cvVOqeDqYEqUzy80ghcVBGvBFXz5Wd7BpjXcZ89qicmig==--bu0bsnyPDgmiuOYF--lQKkvrxSiS0bvgr0FEk8vg==
--------------------------------------------------------------------------------
/config/database.yml:
--------------------------------------------------------------------------------
1 | # SQLite. Versions 3.8.0 and up are supported.
2 | # gem install sqlite3
3 | #
4 | # Ensure the SQLite 3 gem is defined in your Gemfile
5 | # gem "sqlite3"
6 | #
7 | default: &default
8 | adapter: sqlite3
9 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10 | timeout: 5000
11 |
12 | development:
13 | <<: *default
14 | database: db/development.sqlite3
15 |
16 | # Warning: The database defined as "test" will be erased and
17 | # re-generated from your development database when you run "rake".
18 | # Do not set this db to the same as development or production.
19 | test:
20 | <<: *default
21 | database: db/test.sqlite3
22 |
23 | production:
24 | <<: *default
25 | database: db/production.sqlite3
26 |
--------------------------------------------------------------------------------
/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require_relative "application"
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | require 'active_support/core_ext/integer/time'
2 |
3 | Rails.application.configure do
4 | # Settings specified here will take precedence over those in config/application.rb.
5 | # Dig for credentials
6 | ENV['GOOGLE_OAUTH_CLIENT_ID'] = Rails.application.credentials.dig(:google_oauth_client_id)
7 |
8 | ENV['GOOGLE_OAUTH_CLIENT_SECRET'] = Rails.application.credentials.dig(:google_oauth_client_secret)
9 | # In the development environment your application's code is reloaded any time
10 | # it changes. This slows down response time but is perfect for development
11 | # since you don't have to restart the web server when you make code changes.
12 | config.cache_classes = false
13 |
14 | # Do not eager load code on boot.
15 | config.eager_load = false
16 |
17 | # Show full error reports.
18 | config.consider_all_requests_local = true
19 |
20 | # Enable server timing
21 | config.server_timing = true
22 |
23 | # Enable/disable caching. By default caching is disabled.
24 | # Run rails dev:cache to toggle caching.
25 | if Rails.root.join('tmp/caching-dev.txt').exist?
26 | config.action_controller.perform_caching = true
27 | config.action_controller.enable_fragment_cache_logging = true
28 |
29 | config.cache_store = :memory_store
30 | config.public_file_server.headers = {
31 | 'Cache-Control' => "public, max-age=#{2.days.to_i}"
32 | }
33 | else
34 | config.action_controller.perform_caching = false
35 |
36 | config.cache_store = :null_store
37 | end
38 |
39 | # Store uploaded files on the local file system (see config/storage.yml for options).
40 | config.active_storage.service = :local
41 |
42 | # Don't care if the mailer can't send.
43 | config.action_mailer.raise_delivery_errors = false
44 |
45 | config.action_mailer.perform_caching = false
46 |
47 | # Print deprecation notices to the Rails logger.
48 | config.active_support.deprecation = :log
49 |
50 | # Raise exceptions for disallowed deprecations.
51 | config.active_support.disallowed_deprecation = :raise
52 |
53 | # Tell Active Support which deprecation messages to disallow.
54 | config.active_support.disallowed_deprecation_warnings = []
55 |
56 | # Raise an error on page load if there are pending migrations.
57 | config.active_record.migration_error = :page_load
58 |
59 | # Highlight code that triggered database queries in logs.
60 | config.active_record.verbose_query_logs = true
61 |
62 | # Suppress logger output for asset requests.
63 | config.assets.quiet = true
64 |
65 | # Raises error for missing translations.
66 | # config.i18n.raise_on_missing_translations = true
67 |
68 | # Annotate rendered view with file names.
69 | # config.action_view.annotate_rendered_view_with_filenames = true
70 |
71 | # Uncomment if you wish to allow Action Cable access from any origin.
72 | # config.action_cable.disable_request_forgery_protection = true
73 | end
74 |
--------------------------------------------------------------------------------
/config/environments/production.rb:
--------------------------------------------------------------------------------
1 | require "active_support/core_ext/integer/time"
2 |
3 | Rails.application.configure do
4 | # Settings specified here will take precedence over those in config/application.rb.
5 |
6 | # Code is not reloaded between requests.
7 | config.cache_classes = true
8 |
9 | # Eager load code on boot. This eager loads most of Rails and
10 | # your application in memory, allowing both threaded web servers
11 | # and those relying on copy on write to perform better.
12 | # Rake tasks automatically ignore this option for performance.
13 | config.eager_load = true
14 |
15 | # Full error reports are disabled and caching is turned on.
16 | config.consider_all_requests_local = false
17 | config.action_controller.perform_caching = true
18 |
19 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
20 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
21 | # config.require_master_key = true
22 |
23 | # Disable serving static files from the `/public` folder by default since
24 | # Apache or NGINX already handles this.
25 | config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
26 |
27 | # Compress CSS using a preprocessor.
28 | # config.assets.css_compressor = :sass
29 |
30 | # Do not fallback to assets pipeline if a precompiled asset is missed.
31 | config.assets.compile = false
32 |
33 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
34 | # config.asset_host = "http://assets.example.com"
35 |
36 | # Specifies the header that your server uses for sending files.
37 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
38 | # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
39 |
40 | # Store uploaded files on the local file system (see config/storage.yml for options).
41 | config.active_storage.service = :local
42 |
43 | # Mount Action Cable outside main process or domain.
44 | # config.action_cable.mount_path = nil
45 | # config.action_cable.url = "wss://example.com/cable"
46 | # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
47 |
48 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
49 | # config.force_ssl = true
50 |
51 | # Include generic and useful information about system operation, but avoid logging too much
52 | # information to avoid inadvertent exposure of personally identifiable information (PII).
53 | config.log_level = :info
54 |
55 | # Prepend all log lines with the following tags.
56 | config.log_tags = [ :request_id ]
57 |
58 | # Use a different cache store in production.
59 | # config.cache_store = :mem_cache_store
60 |
61 | # Use a real queuing backend for Active Job (and separate queues per environment).
62 | # config.active_job.queue_adapter = :resque
63 | # config.active_job.queue_name_prefix = "omni_auth_google_production"
64 |
65 | config.action_mailer.perform_caching = false
66 |
67 | # Ignore bad email addresses and do not raise email delivery errors.
68 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
69 | # config.action_mailer.raise_delivery_errors = false
70 |
71 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
72 | # the I18n.default_locale when a translation cannot be found).
73 | config.i18n.fallbacks = true
74 |
75 | # Don't log any deprecations.
76 | config.active_support.report_deprecations = false
77 |
78 | # Use default logging formatter so that PID and timestamp are not suppressed.
79 | config.log_formatter = ::Logger::Formatter.new
80 |
81 | # Use a different logger for distributed setups.
82 | # require "syslog/logger"
83 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
84 |
85 | if ENV["RAILS_LOG_TO_STDOUT"].present?
86 | logger = ActiveSupport::Logger.new(STDOUT)
87 | logger.formatter = config.log_formatter
88 | config.logger = ActiveSupport::TaggedLogging.new(logger)
89 | end
90 |
91 | # Do not dump schema after migrations.
92 | config.active_record.dump_schema_after_migration = false
93 | end
94 |
--------------------------------------------------------------------------------
/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | require "active_support/core_ext/integer/time"
2 |
3 | # The test environment is used exclusively to run your application's
4 | # test suite. You never need to work with it otherwise. Remember that
5 | # your test database is "scratch space" for the test suite and is wiped
6 | # and recreated between test runs. Don't rely on the data there!
7 |
8 | Rails.application.configure do
9 | # Settings specified here will take precedence over those in config/application.rb.
10 |
11 | # Turn false under Spring and add config.action_view.cache_template_loading = true.
12 | config.cache_classes = true
13 |
14 | # Eager loading loads your whole application. When running a single test locally,
15 | # this probably isn't necessary. It's a good idea to do in a continuous integration
16 | # system, or in some way before deploying your code.
17 | config.eager_load = ENV["CI"].present?
18 |
19 | # Configure public file server for tests with Cache-Control for performance.
20 | config.public_file_server.enabled = true
21 | config.public_file_server.headers = {
22 | "Cache-Control" => "public, max-age=#{1.hour.to_i}"
23 | }
24 |
25 | # Show full error reports and disable caching.
26 | config.consider_all_requests_local = true
27 | config.action_controller.perform_caching = false
28 | config.cache_store = :null_store
29 |
30 | # Raise exceptions instead of rendering exception templates.
31 | config.action_dispatch.show_exceptions = false
32 |
33 | # Disable request forgery protection in test environment.
34 | config.action_controller.allow_forgery_protection = false
35 |
36 | # Store uploaded files on the local file system in a temporary directory.
37 | config.active_storage.service = :test
38 |
39 | config.action_mailer.perform_caching = false
40 |
41 | # Tell Action Mailer not to deliver emails to the real world.
42 | # The :test delivery method accumulates sent emails in the
43 | # ActionMailer::Base.deliveries array.
44 | config.action_mailer.delivery_method = :test
45 |
46 | # Print deprecation notices to the stderr.
47 | config.active_support.deprecation = :stderr
48 |
49 | # Raise exceptions for disallowed deprecations.
50 | config.active_support.disallowed_deprecation = :raise
51 |
52 | # Tell Active Support which deprecation messages to disallow.
53 | config.active_support.disallowed_deprecation_warnings = []
54 |
55 | # Raises error for missing translations.
56 | # config.i18n.raise_on_missing_translations = true
57 |
58 | # Annotate rendered view with file names.
59 | # config.action_view.annotate_rendered_view_with_filenames = true
60 | end
61 |
--------------------------------------------------------------------------------
/config/importmap.rb:
--------------------------------------------------------------------------------
1 | # Pin npm packages by running ./bin/importmap
2 |
3 | pin "application", preload: true
4 | pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
5 | pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
6 | pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
7 | pin_all_from "app/javascript/controllers", under: "controllers"
8 |
--------------------------------------------------------------------------------
/config/initializers/assets.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Version of your assets, change this if you want to expire all your assets.
4 | Rails.application.config.assets.version = "1.0"
5 |
6 | # Add additional assets to the asset load path.
7 | # Rails.application.config.assets.paths << Emoji.images_path
8 |
9 | # Precompile additional assets.
10 | # application.js, application.css, and all non-JS/CSS in the app/assets
11 | # folder are already added.
12 | # Rails.application.config.assets.precompile += %w( admin.js admin.css )
13 |
--------------------------------------------------------------------------------
/config/initializers/content_security_policy.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Define an application-wide content security policy
4 | # For further information see the following documentation
5 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
6 |
7 | # Rails.application.configure do
8 | # config.content_security_policy do |policy|
9 | # policy.default_src :self, :https
10 | # policy.font_src :self, :https, :data
11 | # policy.img_src :self, :https, :data
12 | # policy.object_src :none
13 | # policy.script_src :self, :https
14 | # policy.style_src :self, :https
15 | # # Specify URI for violation reports
16 | # # policy.report_uri "/csp-violation-report-endpoint"
17 | # end
18 | #
19 | # # Generate session nonces for permitted importmap and inline scripts
20 | # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
21 | # config.content_security_policy_nonce_directives = %w(script-src)
22 | #
23 | # # Report CSP violations to a specified URI. See:
24 | # # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
25 | # # config.content_security_policy_report_only = true
26 | # end
27 |
--------------------------------------------------------------------------------
/config/initializers/devise.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # Assuming you have not yet modified this file, each configuration option below
4 | # is set to its default value. Note that some are commented out while others
5 | # are not: uncommented lines are intended to protect your configuration from
6 | # breaking changes in upgrades (i.e., in the event that future versions of
7 | # Devise change the default values for those options).
8 | #
9 | # Use this hook to configure devise mailer, warden hooks and so forth.
10 | # Many of these configuration options can be set straight in your model.
11 | Devise.setup do |config|
12 | # The secret key used by Devise. Devise uses this key to generate
13 | # random tokens. Changing this key will render invalid all existing
14 | # confirmation, reset password and unlock tokens in the database.
15 | # Devise will use the `secret_key_base` as its `secret_key`
16 | # by default. You can change it below and use your own secret key.
17 | # config.secret_key = '6e1e64d2323e5275b074b9722143e6ed6c6c153bc6e563a0a23f2bcddaedeaf9f16e2290a5e43df945830369a3da03ee7144d5b6fb92b8f748152b5059d5251d'
18 |
19 | # ==> Controller configuration
20 | # Configure the parent class to the devise controllers.
21 | # config.parent_controller = 'DeviseController'
22 |
23 | # ==> Mailer Configuration
24 | # Configure the e-mail address which will be shown in Devise::Mailer,
25 | # note that it will be overwritten if you use your own mailer class
26 | # with default "from" parameter.
27 | config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
28 | config.omniauth :google_oauth2, ENV['GOOGLE_OAUTH_CLIENT_ID'], ENV['GOOGLE_OAUTH_CLIENT_SECRET']
29 |
30 | # Configure the class responsible to send e-mails.
31 | # config.mailer = 'Devise::Mailer'
32 |
33 | # Configure the parent class responsible to send e-mails.
34 | # config.parent_mailer = 'ActionMailer::Base'
35 |
36 | # ==> ORM configuration
37 | # Load and configure the ORM. Supports :active_record (default) and
38 | # :mongoid (bson_ext recommended) by default. Other ORMs may be
39 | # available as additional gems.
40 | require 'devise/orm/active_record'
41 |
42 | # ==> Configuration for any authentication mechanism
43 | # Configure which keys are used when authenticating a user. The default is
44 | # just :email. You can configure it to use [:username, :subdomain], so for
45 | # authenticating a user, both parameters are required. Remember that those
46 | # parameters are used only when authenticating and not when retrieving from
47 | # session. If you need permissions, you should implement that in a before filter.
48 | # You can also supply a hash where the value is a boolean determining whether
49 | # or not authentication should be aborted when the value is not present.
50 | # config.authentication_keys = [:email]
51 |
52 | # Configure parameters from the request object used for authentication. Each entry
53 | # given should be a request method and it will automatically be passed to the
54 | # find_for_authentication method and considered in your model lookup. For instance,
55 | # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
56 | # The same considerations mentioned for authentication_keys also apply to request_keys.
57 | # config.request_keys = []
58 |
59 | # Configure which authentication keys should be case-insensitive.
60 | # These keys will be downcased upon creating or modifying a user and when used
61 | # to authenticate or find a user. Default is :email.
62 | config.case_insensitive_keys = [:email]
63 |
64 | # Configure which authentication keys should have whitespace stripped.
65 | # These keys will have whitespace before and after removed upon creating or
66 | # modifying a user and when used to authenticate or find a user. Default is :email.
67 | config.strip_whitespace_keys = [:email]
68 |
69 | # Tell if authentication through request.params is enabled. True by default.
70 | # It can be set to an array that will enable params authentication only for the
71 | # given strategies, for example, `config.params_authenticatable = [:database]` will
72 | # enable it only for database (email + password) authentication.
73 | # config.params_authenticatable = true
74 |
75 | # Tell if authentication through HTTP Auth is enabled. False by default.
76 | # It can be set to an array that will enable http authentication only for the
77 | # given strategies, for example, `config.http_authenticatable = [:database]` will
78 | # enable it only for database authentication.
79 | # For API-only applications to support authentication "out-of-the-box", you will likely want to
80 | # enable this with :database unless you are using a custom strategy.
81 | # The supported strategies are:
82 | # :database = Support basic authentication with authentication key + password
83 | # config.http_authenticatable = false
84 |
85 | # If 401 status code should be returned for AJAX requests. True by default.
86 | # config.http_authenticatable_on_xhr = true
87 |
88 | # The realm used in Http Basic Authentication. 'Application' by default.
89 | # config.http_authentication_realm = 'Application'
90 |
91 | # It will change confirmation, password recovery and other workflows
92 | # to behave the same regardless if the e-mail provided was right or wrong.
93 | # Does not affect registerable.
94 | # config.paranoid = true
95 |
96 | # By default Devise will store the user in session. You can skip storage for
97 | # particular strategies by setting this option.
98 | # Notice that if you are skipping storage for all authentication paths, you
99 | # may want to disable generating routes to Devise's sessions controller by
100 | # passing skip: :sessions to `devise_for` in your config/routes.rb
101 | config.skip_session_storage = [:http_auth]
102 |
103 | # By default, Devise cleans up the CSRF token on authentication to
104 | # avoid CSRF token fixation attacks. This means that, when using AJAX
105 | # requests for sign in and sign up, you need to get a new CSRF token
106 | # from the server. You can disable this option at your own risk.
107 | # config.clean_up_csrf_token_on_authentication = true
108 |
109 | # When false, Devise will not attempt to reload routes on eager load.
110 | # This can reduce the time taken to boot the app but if your application
111 | # requires the Devise mappings to be loaded during boot time the application
112 | # won't boot properly.
113 | # config.reload_routes = true
114 |
115 | # ==> Configuration for :database_authenticatable
116 | # For bcrypt, this is the cost for hashing the password and defaults to 12. If
117 | # using other algorithms, it sets how many times you want the password to be hashed.
118 | # The number of stretches used for generating the hashed password are stored
119 | # with the hashed password. This allows you to change the stretches without
120 | # invalidating existing passwords.
121 | #
122 | # Limiting the stretches to just one in testing will increase the performance of
123 | # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
124 | # a value less than 10 in other environments. Note that, for bcrypt (the default
125 | # algorithm), the cost increases exponentially with the number of stretches (e.g.
126 | # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
127 | config.stretches = Rails.env.test? ? 1 : 12
128 |
129 | # Set up a pepper to generate the hashed password.
130 | # config.pepper = 'cf738b1e90ead1d9b7a7b113c937d5480f9d15eb95926b7f171b4afa3957176436bd089bced4b456c79a31612ab3dfc631045ca3dfb7d78d2f21f37014086b25'
131 |
132 | # Send a notification to the original email when the user's email is changed.
133 | # config.send_email_changed_notification = false
134 |
135 | # Send a notification email when the user's password is changed.
136 | # config.send_password_change_notification = false
137 |
138 | # ==> Configuration for :confirmable
139 | # A period that the user is allowed to access the website even without
140 | # confirming their account. For instance, if set to 2.days, the user will be
141 | # able to access the website for two days without confirming their account,
142 | # access will be blocked just in the third day.
143 | # You can also set it to nil, which will allow the user to access the website
144 | # without confirming their account.
145 | # Default is 0.days, meaning the user cannot access the website without
146 | # confirming their account.
147 | # config.allow_unconfirmed_access_for = 2.days
148 |
149 | # A period that the user is allowed to confirm their account before their
150 | # token becomes invalid. For example, if set to 3.days, the user can confirm
151 | # their account within 3 days after the mail was sent, but on the fourth day
152 | # their account can't be confirmed with the token any more.
153 | # Default is nil, meaning there is no restriction on how long a user can take
154 | # before confirming their account.
155 | # config.confirm_within = 3.days
156 |
157 | # If true, requires any email changes to be confirmed (exactly the same way as
158 | # initial account confirmation) to be applied. Requires additional unconfirmed_email
159 | # db field (see migrations). Until confirmed, new email is stored in
160 | # unconfirmed_email column, and copied to email column on successful confirmation.
161 | config.reconfirmable = true
162 |
163 | # Defines which key will be used when confirming an account
164 | # config.confirmation_keys = [:email]
165 |
166 | # ==> Configuration for :rememberable
167 | # The time the user will be remembered without asking for credentials again.
168 | # config.remember_for = 2.weeks
169 |
170 | # Invalidates all the remember me tokens when the user signs out.
171 | config.expire_all_remember_me_on_sign_out = true
172 |
173 | # If true, extends the user's remember period when remembered via cookie.
174 | # config.extend_remember_period = false
175 |
176 | # Options to be passed to the created cookie. For instance, you can set
177 | # secure: true in order to force SSL only cookies.
178 | # config.rememberable_options = {}
179 |
180 | # ==> Configuration for :validatable
181 | # Range for password length.
182 | config.password_length = 6..128
183 |
184 | # Email regex used to validate email formats. It simply asserts that
185 | # one (and only one) @ exists in the given string. This is mainly
186 | # to give user feedback and not to assert the e-mail validity.
187 | config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
188 |
189 | # ==> Configuration for :timeoutable
190 | # The time you want to timeout the user session without activity. After this
191 | # time the user will be asked for credentials again. Default is 30 minutes.
192 | # config.timeout_in = 30.minutes
193 |
194 | # ==> Configuration for :lockable
195 | # Defines which strategy will be used to lock an account.
196 | # :failed_attempts = Locks an account after a number of failed attempts to sign in.
197 | # :none = No lock strategy. You should handle locking by yourself.
198 | # config.lock_strategy = :failed_attempts
199 |
200 | # Defines which key will be used when locking and unlocking an account
201 | # config.unlock_keys = [:email]
202 |
203 | # Defines which strategy will be used to unlock an account.
204 | # :email = Sends an unlock link to the user email
205 | # :time = Re-enables login after a certain amount of time (see :unlock_in below)
206 | # :both = Enables both strategies
207 | # :none = No unlock strategy. You should handle unlocking by yourself.
208 | # config.unlock_strategy = :both
209 |
210 | # Number of authentication tries before locking an account if lock_strategy
211 | # is failed attempts.
212 | # config.maximum_attempts = 20
213 |
214 | # Time interval to unlock the account if :time is enabled as unlock_strategy.
215 | # config.unlock_in = 1.hour
216 |
217 | # Warn on the last attempt before the account is locked.
218 | # config.last_attempt_warning = true
219 |
220 | # ==> Configuration for :recoverable
221 | #
222 | # Defines which key will be used when recovering the password for an account
223 | # config.reset_password_keys = [:email]
224 |
225 | # Time interval you can reset your password with a reset password key.
226 | # Don't put a too small interval or your users won't have the time to
227 | # change their passwords.
228 | config.reset_password_within = 6.hours
229 |
230 | # When set to false, does not sign a user in automatically after their password is
231 | # reset. Defaults to true, so a user is signed in automatically after a reset.
232 | # config.sign_in_after_reset_password = true
233 |
234 | # ==> Configuration for :encryptable
235 | # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
236 | # You can use :sha1, :sha512 or algorithms from others authentication tools as
237 | # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
238 | # for default behavior) and :restful_authentication_sha1 (then you should set
239 | # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
240 | #
241 | # Require the `devise-encryptable` gem when using anything other than bcrypt
242 | # config.encryptor = :sha512
243 |
244 | # ==> Scopes configuration
245 | # Turn scoped views on. Before rendering "sessions/new", it will first check for
246 | # "users/sessions/new". It's turned off by default because it's slower if you
247 | # are using only default views.
248 | # config.scoped_views = false
249 |
250 | # Configure the default scope given to Warden. By default it's the first
251 | # devise role declared in your routes (usually :user).
252 | # config.default_scope = :user
253 |
254 | # Set this configuration to false if you want /users/sign_out to sign out
255 | # only the current scope. By default, Devise signs out all scopes.
256 | # config.sign_out_all_scopes = true
257 |
258 | # ==> Navigation configuration
259 | # Lists the formats that should be treated as navigational. Formats like
260 | # :html, should redirect to the sign in page when the user does not have
261 | # access, but formats like :xml or :json, should return 401.
262 | #
263 | # If you have any extra navigational formats, like :iphone or :mobile, you
264 | # should add them to the navigational formats lists.
265 | #
266 | # The "*/*" below is required to match Internet Explorer requests.
267 | config.navigational_formats = ['*/*', :html, :turbo_html]
268 |
269 | # The default HTTP method used to sign out a resource. Default is :delete.
270 | config.sign_out_via = :delete
271 |
272 | # ==> OmniAuth
273 | # Add a new OmniAuth provider. Check the wiki for more information on setting
274 | # up on your models and hooks.
275 | # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
276 |
277 | # ==> Warden configuration
278 | # If you want to use other strategies, that are not supported by Devise, or
279 | # change the failure app, you can configure them inside the config.warden block.
280 | #
281 | # config.warden do |manager|
282 | # manager.intercept_401 = false
283 | # manager.default_strategies(scope: :user).unshift :some_external_strategy
284 | # end
285 |
286 | # ==> Mountable engine configurations
287 | # When using Devise inside an engine, let's call it `MyEngine`, and this engine
288 | # is mountable, there are some extra configurations to be taken into account.
289 | # The following options are available, assuming the engine is mounted as:
290 | #
291 | # mount MyEngine, at: '/my_engine'
292 | #
293 | # The router that invoked `devise_for`, in the example above, would be:
294 | # config.router_name = :my_engine
295 | #
296 | # When using OmniAuth, Devise cannot automatically set OmniAuth path,
297 | # so you need to do it manually. For the users scope, it would be:
298 | # config.omniauth_path_prefix = '/my_engine/users/auth'
299 |
300 | # ==> Turbolinks configuration
301 | # If your app is using Turbolinks, Turbolinks::Controller needs to be included to make redirection work correctly:
302 | #
303 | # ActiveSupport.on_load(:devise_failure_app) do
304 | # include Turbolinks::Controller
305 | # end
306 |
307 | # ==> Configuration for :registerable
308 |
309 | # When set to false, does not sign a user in automatically after their password is
310 | # changed. Defaults to true, so a user is signed in automatically after changing a password.
311 | # config.sign_in_after_change_password = true
312 | end
313 |
--------------------------------------------------------------------------------
/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure parameters to be filtered from the log file. Use this to limit dissemination of
4 | # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
5 | # notations and behaviors.
6 | Rails.application.config.filter_parameters += [
7 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
8 | ]
9 |
--------------------------------------------------------------------------------
/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format. Inflections
4 | # are locale specific, and you may define rules for as many different
5 | # locales as you wish. All of these examples are active by default:
6 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 | # inflect.plural /^(ox)$/i, "\\1en"
8 | # inflect.singular /^(ox)en/i, "\\1"
9 | # inflect.irregular "person", "people"
10 | # inflect.uncountable %w( fish sheep )
11 | # end
12 |
13 | # These inflection rules are supported but not enabled by default:
14 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 | # inflect.acronym "RESTful"
16 | # end
17 |
--------------------------------------------------------------------------------
/config/initializers/permissions_policy.rb:
--------------------------------------------------------------------------------
1 | # Define an application-wide HTTP permissions policy. For further
2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy
3 | #
4 | # Rails.application.config.permissions_policy do |f|
5 | # f.camera :none
6 | # f.gyroscope :none
7 | # f.microphone :none
8 | # f.usb :none
9 | # f.fullscreen :self
10 | # f.payment :self, "https://secure.example.com"
11 | # end
12 |
--------------------------------------------------------------------------------
/config/locales/devise.en.yml:
--------------------------------------------------------------------------------
1 | # Additional translations at https://github.com/heartcombo/devise/wiki/I18n
2 |
3 | en:
4 | devise:
5 | confirmations:
6 | confirmed: "Your email address has been successfully confirmed."
7 | send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
8 | send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
9 | failure:
10 | already_authenticated: "You are already signed in."
11 | inactive: "Your account is not activated yet."
12 | invalid: "Invalid %{authentication_keys} or password."
13 | locked: "Your account is locked."
14 | last_attempt: "You have one more attempt before your account is locked."
15 | not_found_in_database: "Invalid %{authentication_keys} or password."
16 | timeout: "Your session expired. Please sign in again to continue."
17 | unauthenticated: "You need to sign in or sign up before continuing."
18 | unconfirmed: "You have to confirm your email address before continuing."
19 | mailer:
20 | confirmation_instructions:
21 | subject: "Confirmation instructions"
22 | reset_password_instructions:
23 | subject: "Reset password instructions"
24 | unlock_instructions:
25 | subject: "Unlock instructions"
26 | email_changed:
27 | subject: "Email Changed"
28 | password_change:
29 | subject: "Password Changed"
30 | omniauth_callbacks:
31 | failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
32 | success: "Successfully authenticated from %{kind} account."
33 | passwords:
34 | no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
35 | send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
36 | send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
37 | updated: "Your password has been changed successfully. You are now signed in."
38 | updated_not_active: "Your password has been changed successfully."
39 | registrations:
40 | destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
41 | signed_up: "Welcome! You have signed up successfully."
42 | signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
43 | signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
44 | signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
45 | update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address."
46 | updated: "Your account has been updated successfully."
47 | updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again."
48 | sessions:
49 | signed_in: "Signed in successfully."
50 | signed_out: "Signed out successfully."
51 | already_signed_out: "Signed out successfully."
52 | unlocks:
53 | send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
54 | send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
55 | unlocked: "Your account has been unlocked successfully. Please sign in to continue."
56 | errors:
57 | messages:
58 | already_confirmed: "was already confirmed, please try signing in"
59 | confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
60 | expired: "has expired, please request a new one"
61 | not_found: "not found"
62 | not_locked: "was not locked"
63 | not_saved:
64 | one: "1 error prohibited this %{resource} from being saved:"
65 | other: "%{count} errors prohibited this %{resource} from being saved:"
66 |
--------------------------------------------------------------------------------
/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization
2 | # and are automatically loaded by Rails. If you want to use locales other
3 | # than English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t "hello"
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t("hello") %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # The following keys must be escaped otherwise they will not be retrieved by
20 | # the default I18n backend:
21 | #
22 | # true, false, on, off, yes, no
23 | #
24 | # Instead, surround them with single quotes.
25 | #
26 | # en:
27 | # "true": "foo"
28 | #
29 | # To learn more, please read the Rails Internationalization guide
30 | # available at https://guides.rubyonrails.org/i18n.html.
31 |
32 | en:
33 | hello: "Hello world"
34 |
--------------------------------------------------------------------------------
/config/puma.rb:
--------------------------------------------------------------------------------
1 | # Puma can serve each request in a thread from an internal thread pool.
2 | # The `threads` method setting takes two numbers: a minimum and maximum.
3 | # Any libraries that use thread pools should be configured to match
4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum
5 | # and maximum; this matches the default thread size of Active Record.
6 | #
7 | max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8 | min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
9 | threads min_threads_count, max_threads_count
10 |
11 | # Specifies the `worker_timeout` threshold that Puma will use to wait before
12 | # terminating a worker in development environments.
13 | #
14 | worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
15 |
16 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
17 | #
18 | port ENV.fetch("PORT") { 3000 }
19 |
20 | # Specifies the `environment` that Puma will run in.
21 | #
22 | environment ENV.fetch("RAILS_ENV") { "development" }
23 |
24 | # Specifies the `pidfile` that Puma will use.
25 | pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
26 |
27 | # Specifies the number of `workers` to boot in clustered mode.
28 | # Workers are forked web server processes. If using threads and workers together
29 | # the concurrency of the application would be max `threads` * `workers`.
30 | # Workers do not work on JRuby or Windows (both of which do not support
31 | # processes).
32 | #
33 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
34 |
35 | # Use the `preload_app!` method when specifying a `workers` number.
36 | # This directive tells Puma to first boot the application and load code
37 | # before forking the application. This takes advantage of Copy On Write
38 | # process behavior so workers use less memory.
39 | #
40 | # preload_app!
41 |
42 | # Allow puma to be restarted by `bin/rails restart` command.
43 | plugin :tmp_restart
44 |
--------------------------------------------------------------------------------
/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | root 'pages#home'
3 | devise_for :users, controllers: {
4 | omniauth_callbacks: 'users/omniauth_callbacks',
5 | sessions: 'users/sessions',
6 | registrations: 'users/registrations'
7 | }
8 | # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
9 |
10 | # Defines the root path route ("/")
11 | # root "articles#index"
12 | end
13 |
--------------------------------------------------------------------------------
/config/storage.yml:
--------------------------------------------------------------------------------
1 | test:
2 | service: Disk
3 | root: <%= Rails.root.join("tmp/storage") %>
4 |
5 | local:
6 | service: Disk
7 | root: <%= Rails.root.join("storage") %>
8 |
9 | # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10 | # amazon:
11 | # service: S3
12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14 | # region: us-east-1
15 | # bucket: your_own_bucket-<%= Rails.env %>
16 |
17 | # Remember not to checkin your GCS keyfile to a repository
18 | # google:
19 | # service: GCS
20 | # project: your_project
21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22 | # bucket: your_own_bucket-<%= Rails.env %>
23 |
24 | # Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25 | # microsoft:
26 | # service: AzureStorage
27 | # storage_account_name: your_account_name
28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29 | # container: your_container_name-<%= Rails.env %>
30 |
31 | # mirror:
32 | # service: Mirror
33 | # primary: local
34 | # mirrors: [ amazon, google, microsoft ]
35 |
--------------------------------------------------------------------------------
/db/migrate/20220509071456_devise_create_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class DeviseCreateUsers < ActiveRecord::Migration[7.0]
4 | def change
5 | create_table :users do |t|
6 | t.string :full_name
7 | t.string :uid
8 | t.string :avatar_url
9 | t.string :provider
10 |
11 | ## Database authenticatable
12 | t.string :email, null: false, default: ''
13 | t.string :encrypted_password, null: false, default: ''
14 |
15 | ## Recoverable
16 | t.string :reset_password_token
17 | t.datetime :reset_password_sent_at
18 |
19 | ## Rememberable
20 | t.datetime :remember_created_at
21 |
22 | ## Trackable
23 | # t.integer :sign_in_count, default: 0, null: false
24 | # t.datetime :current_sign_in_at
25 | # t.datetime :last_sign_in_at
26 | # t.string :current_sign_in_ip
27 | # t.string :last_sign_in_ip
28 |
29 | ## Confirmable
30 | # t.string :confirmation_token
31 | # t.datetime :confirmed_at
32 | # t.datetime :confirmation_sent_at
33 | # t.string :unconfirmed_email # Only if using reconfirmable
34 |
35 | ## Lockable
36 | # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
37 | # t.string :unlock_token # Only if unlock strategy is :email or :both
38 | # t.datetime :locked_at
39 |
40 | t.timestamps null: false
41 | end
42 |
43 | add_index :users, :email, unique: true
44 | add_index :users, :reset_password_token, unique: true
45 | # add_index :users, :confirmation_token, unique: true
46 | # add_index :users, :unlock_token, unique: true
47 | end
48 | end
49 |
--------------------------------------------------------------------------------
/db/schema.rb:
--------------------------------------------------------------------------------
1 | # This file is auto-generated from the current state of the database. Instead
2 | # of editing this file, please use the migrations feature of Active Record to
3 | # incrementally modify your database, and then regenerate this schema definition.
4 | #
5 | # This file is the source Rails uses to define your schema when running `bin/rails
6 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7 | # be faster and is potentially less error prone than running all of your
8 | # migrations from scratch. Old migrations may fail to apply correctly if those
9 | # migrations use external dependencies or application code.
10 | #
11 | # It's strongly recommended that you check this file into your version control system.
12 |
13 | ActiveRecord::Schema[7.0].define(version: 2022_05_09_071456) do
14 | create_table "users", force: :cascade do |t|
15 | t.string "full_name"
16 | t.string "uid"
17 | t.string "avatar_url"
18 | t.string "provider"
19 | t.string "email", default: "", null: false
20 | t.string "encrypted_password", default: "", null: false
21 | t.string "reset_password_token"
22 | t.datetime "reset_password_sent_at"
23 | t.datetime "remember_created_at"
24 | t.datetime "created_at", null: false
25 | t.datetime "updated_at", null: false
26 | t.index ["email"], name: "index_users_on_email", unique: true
27 | t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
28 | end
29 |
30 | end
31 |
--------------------------------------------------------------------------------
/db/seeds.rb:
--------------------------------------------------------------------------------
1 | # This file should contain all the record creation needed to seed the database with its default values.
2 | # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
3 | #
4 | # Examples:
5 | #
6 | # movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }])
7 | # Character.create(name: "Luke", movie: movies.first)
8 |
--------------------------------------------------------------------------------
/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/lib/assets/.keep
--------------------------------------------------------------------------------
/lib/tasks/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/lib/tasks/.keep
--------------------------------------------------------------------------------
/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/log/.keep
--------------------------------------------------------------------------------
/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The page you were looking for doesn't exist (404)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The page you were looking for doesn't exist.
62 |
You may have mistyped the address or the page may have moved.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/public/422.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The change you wanted was rejected (422)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The change you wanted was rejected.
62 |
Maybe you tried to change something you didn't have access to.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/public/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | We're sorry, but something went wrong (500)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
We're sorry, but something went wrong.
62 |
63 |
If you are the application owner check the logs for more information.
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/public/apple-touch-icon-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/public/apple-touch-icon-precomposed.png
--------------------------------------------------------------------------------
/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/public/favicon.ico
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 |
--------------------------------------------------------------------------------
/storage/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/storage/.keep
--------------------------------------------------------------------------------
/test/application_system_test_case.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
5 | end
6 |
--------------------------------------------------------------------------------
/test/channels/application_cable/connection_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase
4 | # test "connects with cookies" do
5 | # cookies.signed[:user_id] = 42
6 | #
7 | # connect
8 | #
9 | # assert_equal connection.user_id, "42"
10 | # end
11 | end
12 |
--------------------------------------------------------------------------------
/test/controllers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/test/controllers/.keep
--------------------------------------------------------------------------------
/test/controllers/pages_controller_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class PagesControllerTest < ActionDispatch::IntegrationTest
4 | test "should get home" do
5 | get pages_home_url
6 | assert_response :success
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/test/fixtures/files/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/test/fixtures/files/.keep
--------------------------------------------------------------------------------
/test/fixtures/users.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | # This model initially had no columns defined. If you add columns to the
4 | # model remove the "{}" from the fixture names and add the columns immediately
5 | # below each fixture, per the syntax in the comments below
6 | #
7 | one: {}
8 | # column: value
9 | #
10 | two: {}
11 | # column: value
12 |
--------------------------------------------------------------------------------
/test/helpers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/test/helpers/.keep
--------------------------------------------------------------------------------
/test/integration/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/test/integration/.keep
--------------------------------------------------------------------------------
/test/mailers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/test/mailers/.keep
--------------------------------------------------------------------------------
/test/models/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/test/models/.keep
--------------------------------------------------------------------------------
/test/models/user_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class UserTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/system/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/test/system/.keep
--------------------------------------------------------------------------------
/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | ENV["RAILS_ENV"] ||= "test"
2 | require_relative "../config/environment"
3 | require "rails/test_help"
4 |
5 | class ActiveSupport::TestCase
6 | # Run tests in parallel with specified workers
7 | parallelize(workers: :number_of_processors)
8 |
9 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
10 | fixtures :all
11 |
12 | # Add more helper methods to be used by all tests here...
13 | end
14 |
--------------------------------------------------------------------------------
/tmp/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/tmp/.keep
--------------------------------------------------------------------------------
/tmp/pids/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/tmp/pids/.keep
--------------------------------------------------------------------------------
/tmp/storage/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/tmp/storage/.keep
--------------------------------------------------------------------------------
/vendor/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/vendor/.keep
--------------------------------------------------------------------------------
/vendor/javascript/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Deanout/omniauth_google/517ccff1b0e787a6c856b70bf757d4da22434c96/vendor/javascript/.keep
--------------------------------------------------------------------------------