devise_jwt_mehak 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/application.rb +30 -0
- data/config/boot.rb +4 -0
- data/config/cable.yml +10 -0
- data/config/credentials.yml.enc +1 -0
- data/config/database.yml +36 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +76 -0
- data/config/environments/production.rb +120 -0
- data/config/environments/test.rb +60 -0
- data/config/initializers/application_controller_renderer.rb +8 -0
- data/config/initializers/assets.rb +14 -0
- data/config/initializers/backtrace_silencers.rb +8 -0
- data/config/initializers/content_security_policy.rb +30 -0
- data/config/initializers/cookies_serializer.rb +5 -0
- data/config/initializers/devise.rb +329 -0
- data/config/initializers/filter_parameter_logging.rb +6 -0
- data/config/initializers/inflections.rb +16 -0
- data/config/initializers/mime_types.rb +4 -0
- data/config/initializers/permissions_policy.rb +11 -0
- data/config/initializers/warden_auth.rb +11 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/locales/devise.en.yml +65 -0
- data/config/locales/en.yml +33 -0
- data/config/master.key +1 -0
- data/config/puma.rb +43 -0
- data/config/routes.rb +40 -0
- data/config/spring.rb +6 -0
- data/config/storage.yml +34 -0
- data/config/webpack/development.js +5 -0
- data/config/webpack/environment.js +3 -0
- data/config/webpack/production.js +5 -0
- data/config/webpack/test.js +5 -0
- data/config/webpacker.yml +92 -0
- data/devise_jwt.gemspec +1 -1
- data/lib/devise_jwt/version.rb +1 -1
- data/lib/generators/service/service_generator.rb +1 -0
- metadata +34 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9665a47a0c71198da857bf1b1f8254ecd215eb0f25f8231d43150b16455f76a6
|
4
|
+
data.tar.gz: 5753bfd5b0e8144823efdf124de68c8ebd6c762f421f08d5b85fa3321b4aeb16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07c0b11e9cdfd699ca5b2b556837a0f6303b6a1332c1afc8e2f9874ea3a8b3ffe5a0618ec0dadea4ffcd27ba1bffa835e3ec25cbc560f3804dda7eb4fa0dbfc2
|
7
|
+
data.tar.gz: dac6f8f073d6546ef3f51515a5aadb776344e41934f7639a1c550dab0cd78a8ee7c05fd8a0f495ad06d8899f6dfc3a82a2dfcf98354921a7f82386291df09c32
|
@@ -0,0 +1,30 @@
|
|
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 DeviseJwt
|
10
|
+
class Application < Rails::Application
|
11
|
+
# Initialize configuration defaults for originally generated Rails version.
|
12
|
+
config.load_defaults 6.1
|
13
|
+
|
14
|
+
config.generators do |g|
|
15
|
+
g.orm :active_record
|
16
|
+
g.template_engine :erb
|
17
|
+
g.test_framework :test_unit, fixture: false
|
18
|
+
g.stylesheets false
|
19
|
+
# g.helper :my_helper
|
20
|
+
end
|
21
|
+
|
22
|
+
# Configuration for the application, engines, and railties goes here.
|
23
|
+
#
|
24
|
+
# These settings can be overridden in specific environments using the files
|
25
|
+
# in config/environments, which are processed later.
|
26
|
+
#
|
27
|
+
# config.time_zone = "Central Time (US & Canada)"
|
28
|
+
# config.eager_load_paths << Rails.root.join("extras")
|
29
|
+
end
|
30
|
+
end
|
data/config/boot.rb
ADDED
data/config/cable.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3WKY037eO4E2cl4wL90yz1b1mwui26BPXHn2Rbi9yjygDzw8IWc8EEB2IkzO037x9eTDFxiMCzuom8r3SIe30FdozRw57lfMtDGuTxZaA0GUzYojmw8JUvJnYu/RdePEwK4dfBYl4n+EcuCpZ+6F4ydq/ZN8oCtXzUndypKw1wDQIoJ1HIy3y/NlbgeVNqbqvWYc2j3LfRj6KcuGAhwsrho2R5axgobNRIoIpI/mFlxiu+8JbRSIRuFHDlLx83ZUnid3XcOwrwCSO6eqN6t50JuNodOafp8lM1tKqEmUMDIGPs54lDDo6mDhTmtUA7YLC0FEMBiiYdXh0IrjT5tD6PZjoH/DJhw7Ickxu92U/KeM+pFiY9c9IKatCu0lfZUjToq/fmGi7OAtliipAmTM2WAAz45m78i8yeE7--TmEb0RKioXVItLB2--mDAzKS7K1clU3BTI6/ueiw==
|
data/config/database.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
default: &default
|
2
|
+
adapter: postgresql
|
3
|
+
encoding: unicode
|
4
|
+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
5
|
+
|
6
|
+
development:
|
7
|
+
<<: *default
|
8
|
+
database: devise_development
|
9
|
+
username: mehak
|
10
|
+
password: Mehak@1234
|
11
|
+
|
12
|
+
test:
|
13
|
+
<<: *default
|
14
|
+
database: devise_test
|
15
|
+
username: mehak
|
16
|
+
password: Mehak@1234
|
17
|
+
|
18
|
+
# staging:
|
19
|
+
# <<: *default
|
20
|
+
# database: devise_staging
|
21
|
+
# username: pm_dashboard
|
22
|
+
# password: <%= ENV['PM_DASHBOARD_DATABASE_PASSWORD'] %>
|
23
|
+
|
24
|
+
# production:
|
25
|
+
# <<: *default
|
26
|
+
# database: devise_production
|
27
|
+
# username: pm_dashboard
|
28
|
+
# password: <%= ENV['PM_DASHBOARD_DATABASE_PASSWORD'] %>
|
29
|
+
|
30
|
+
# adapter: postgresql
|
31
|
+
# encoding: unicode
|
32
|
+
# database: pm_dashboard_production
|
33
|
+
# username: pm_dbadmin
|
34
|
+
# password: G266SD2376ilerBRbg085
|
35
|
+
# host: pm-dashboard.cuu7nf3bqiss.us-east-1.rds.amazonaws.com
|
36
|
+
# port: 5432
|
@@ -0,0 +1,76 @@
|
|
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
|
+
# In the development environment your application's code is reloaded any time
|
7
|
+
# it changes. This slows down response time but is perfect for development
|
8
|
+
# since you don't have to restart the web server when you make code changes.
|
9
|
+
config.cache_classes = false
|
10
|
+
|
11
|
+
# Do not eager load code on boot.
|
12
|
+
config.eager_load = false
|
13
|
+
|
14
|
+
# Show full error reports.
|
15
|
+
config.consider_all_requests_local = true
|
16
|
+
|
17
|
+
# Enable/disable caching. By default caching is disabled.
|
18
|
+
# Run rails dev:cache to toggle caching.
|
19
|
+
if Rails.root.join('tmp', 'caching-dev.txt').exist?
|
20
|
+
config.action_controller.perform_caching = true
|
21
|
+
config.action_controller.enable_fragment_cache_logging = true
|
22
|
+
|
23
|
+
config.cache_store = :memory_store
|
24
|
+
config.public_file_server.headers = {
|
25
|
+
'Cache-Control' => "public, max-age=#{2.days.to_i}"
|
26
|
+
}
|
27
|
+
else
|
28
|
+
config.action_controller.perform_caching = false
|
29
|
+
|
30
|
+
config.cache_store = :null_store
|
31
|
+
end
|
32
|
+
|
33
|
+
# Store uploaded files on the local file system (see config/storage.yml for options).
|
34
|
+
config.active_storage.service = :local
|
35
|
+
|
36
|
+
# Don't care if the mailer can't send.
|
37
|
+
config.action_mailer.raise_delivery_errors = false
|
38
|
+
|
39
|
+
config.action_mailer.perform_caching = false
|
40
|
+
|
41
|
+
# Print deprecation notices to the Rails logger.
|
42
|
+
config.active_support.deprecation = :log
|
43
|
+
|
44
|
+
# Raise exceptions for disallowed deprecations.
|
45
|
+
config.active_support.disallowed_deprecation = :raise
|
46
|
+
|
47
|
+
# Tell Active Support which deprecation messages to disallow.
|
48
|
+
config.active_support.disallowed_deprecation_warnings = []
|
49
|
+
|
50
|
+
# Raise an error on page load if there are pending migrations.
|
51
|
+
config.active_record.migration_error = :page_load
|
52
|
+
|
53
|
+
# Highlight code that triggered database queries in logs.
|
54
|
+
config.active_record.verbose_query_logs = true
|
55
|
+
|
56
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
57
|
+
# This option may cause significant delays in view rendering with a large
|
58
|
+
# number of complex assets.
|
59
|
+
config.assets.debug = true
|
60
|
+
|
61
|
+
# Suppress logger output for asset requests.
|
62
|
+
config.assets.quiet = true
|
63
|
+
|
64
|
+
# Raises error for missing translations.
|
65
|
+
# config.i18n.raise_on_missing_translations = true
|
66
|
+
|
67
|
+
# Annotate rendered view with file names.
|
68
|
+
# config.action_view.annotate_rendered_view_with_filenames = true
|
69
|
+
|
70
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
71
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
72
|
+
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
73
|
+
|
74
|
+
# Uncomment if you wish to allow Action Cable access from any origin.
|
75
|
+
# config.action_cable.disable_request_forgery_protection = true
|
76
|
+
end
|
@@ -0,0 +1,120 @@
|
|
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 = "devise_jwt_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
|
+
# Send deprecation notices to registered listeners.
|
76
|
+
config.active_support.deprecation = :notify
|
77
|
+
|
78
|
+
# Log disallowed deprecations.
|
79
|
+
config.active_support.disallowed_deprecation = :log
|
80
|
+
|
81
|
+
# Tell Active Support which deprecation messages to disallow.
|
82
|
+
config.active_support.disallowed_deprecation_warnings = []
|
83
|
+
|
84
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
85
|
+
config.log_formatter = ::Logger::Formatter.new
|
86
|
+
|
87
|
+
# Use a different logger for distributed setups.
|
88
|
+
# require "syslog/logger"
|
89
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
90
|
+
|
91
|
+
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
92
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
93
|
+
logger.formatter = config.log_formatter
|
94
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
95
|
+
end
|
96
|
+
|
97
|
+
# Do not dump schema after migrations.
|
98
|
+
config.active_record.dump_schema_after_migration = false
|
99
|
+
|
100
|
+
# Inserts middleware to perform automatic connection switching.
|
101
|
+
# The `database_selector` hash is used to pass options to the DatabaseSelector
|
102
|
+
# middleware. The `delay` is used to determine how long to wait after a write
|
103
|
+
# to send a subsequent read to the primary.
|
104
|
+
#
|
105
|
+
# The `database_resolver` class is used by the middleware to determine which
|
106
|
+
# database is appropriate to use based on the time delay.
|
107
|
+
#
|
108
|
+
# The `database_resolver_context` class is used by the middleware to set
|
109
|
+
# timestamps for the last write to the primary. The resolver uses the context
|
110
|
+
# class timestamps to determine how long to wait before reading from the
|
111
|
+
# replica.
|
112
|
+
#
|
113
|
+
# By default Rails will store a last write timestamp in the session. The
|
114
|
+
# DatabaseSelector middleware is designed as such you can define your own
|
115
|
+
# strategy for connection switching and pass that into the middleware through
|
116
|
+
# these configuration options.
|
117
|
+
# config.active_record.database_selector = { delay: 2.seconds }
|
118
|
+
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
|
119
|
+
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
|
120
|
+
end
|
@@ -0,0 +1,60 @@
|
|
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
|
+
config.cache_classes = false
|
12
|
+
config.action_view.cache_template_loading = true
|
13
|
+
|
14
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
15
|
+
# just for the purpose of running a single test. If you are using a tool that
|
16
|
+
# preloads Rails for running tests, you may have to set it to true.
|
17
|
+
config.eager_load = false
|
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
|
@@ -0,0 +1,14 @@
|
|
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
|
+
# Add Yarn node_modules folder to the asset load path.
|
9
|
+
Rails.application.config.assets.paths << Rails.root.join('node_modules')
|
10
|
+
|
11
|
+
# Precompile additional assets.
|
12
|
+
# application.js, application.css, and all non-JS/CSS in the app/assets
|
13
|
+
# folder are already added.
|
14
|
+
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code
|
7
|
+
# by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'".
|
8
|
+
Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"]
|
@@ -0,0 +1,30 @@
|
|
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.config.content_security_policy do |policy|
|
8
|
+
# policy.default_src :self, :https
|
9
|
+
# policy.font_src :self, :https, :data
|
10
|
+
# policy.img_src :self, :https, :data
|
11
|
+
# policy.object_src :none
|
12
|
+
# policy.script_src :self, :https
|
13
|
+
# policy.style_src :self, :https
|
14
|
+
# # If you are using webpack-dev-server then specify webpack-dev-server host
|
15
|
+
# policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
|
16
|
+
|
17
|
+
# # Specify URI for violation reports
|
18
|
+
# # policy.report_uri "/csp-violation-report-endpoint"
|
19
|
+
# end
|
20
|
+
|
21
|
+
# If you are using UJS then enable automatic nonce generation
|
22
|
+
# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
|
23
|
+
|
24
|
+
# Set the nonce only to specific directives
|
25
|
+
# Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
|
26
|
+
|
27
|
+
# Report CSP violations to a specified URI
|
28
|
+
# For further information see the following documentation:
|
29
|
+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
|
30
|
+
# Rails.application.config.content_security_policy_report_only = true
|
@@ -0,0 +1,329 @@
|
|
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 = '5153c5064dad54a3aeb7ae23dd0eb2eb53d153c81cc2d573c204dcedcd15c8882e092ecae83b168874d255633d075b02ab70c4cfc86b7242c491b623c6759120'
|
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
|
+
|
29
|
+
# Configure the class responsible to send e-mails.
|
30
|
+
# config.mailer = 'Devise::Mailer'
|
31
|
+
|
32
|
+
# Configure the parent class responsible to send e-mails.
|
33
|
+
# config.parent_mailer = 'ActionMailer::Base'
|
34
|
+
|
35
|
+
# ==> ORM configuration
|
36
|
+
# Load and configure the ORM. Supports :active_record (default) and
|
37
|
+
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
38
|
+
# available as additional gems.
|
39
|
+
require 'devise/orm/active_record'
|
40
|
+
|
41
|
+
# ==> Configuration for any authentication mechanism
|
42
|
+
# Configure which keys are used when authenticating a user. The default is
|
43
|
+
# just :email. You can configure it to use [:username, :subdomain], so for
|
44
|
+
# authenticating a user, both parameters are required. Remember that those
|
45
|
+
# parameters are used only when authenticating and not when retrieving from
|
46
|
+
# session. If you need permissions, you should implement that in a before filter.
|
47
|
+
# You can also supply a hash where the value is a boolean determining whether
|
48
|
+
# or not authentication should be aborted when the value is not present.
|
49
|
+
# config.authentication_keys = [:email]
|
50
|
+
|
51
|
+
# Configure parameters from the request object used for authentication. Each entry
|
52
|
+
# given should be a request method and it will automatically be passed to the
|
53
|
+
# find_for_authentication method and considered in your model lookup. For instance,
|
54
|
+
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
55
|
+
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
56
|
+
# config.request_keys = []
|
57
|
+
|
58
|
+
# Configure which authentication keys should be case-insensitive.
|
59
|
+
# These keys will be downcased upon creating or modifying a user and when used
|
60
|
+
# to authenticate or find a user. Default is :email.
|
61
|
+
config.case_insensitive_keys = [:email]
|
62
|
+
|
63
|
+
# Configure which authentication keys should have whitespace stripped.
|
64
|
+
# These keys will have whitespace before and after removed upon creating or
|
65
|
+
# modifying a user and when used to authenticate or find a user. Default is :email.
|
66
|
+
config.strip_whitespace_keys = [:email]
|
67
|
+
|
68
|
+
# Tell if authentication through request.params is enabled. True by default.
|
69
|
+
# It can be set to an array that will enable params authentication only for the
|
70
|
+
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
71
|
+
# enable it only for database (email + password) authentication.
|
72
|
+
# config.params_authenticatable = true
|
73
|
+
|
74
|
+
# Tell if authentication through HTTP Auth is enabled. False by default.
|
75
|
+
# It can be set to an array that will enable http authentication only for the
|
76
|
+
# given strategies, for example, `config.http_authenticatable = [:database]` will
|
77
|
+
# enable it only for database authentication.
|
78
|
+
# For API-only applications to support authentication "out-of-the-box", you will likely want to
|
79
|
+
# enable this with :database unless you are using a custom strategy.
|
80
|
+
# The supported strategies are:
|
81
|
+
# :database = Support basic authentication with authentication key + password
|
82
|
+
# config.http_authenticatable = false
|
83
|
+
|
84
|
+
# If 401 status code should be returned for AJAX requests. True by default.
|
85
|
+
# config.http_authenticatable_on_xhr = true
|
86
|
+
|
87
|
+
# The realm used in Http Basic Authentication. 'Application' by default.
|
88
|
+
# config.http_authentication_realm = 'Application'
|
89
|
+
|
90
|
+
# It will change confirmation, password recovery and other workflows
|
91
|
+
# to behave the same regardless if the e-mail provided was right or wrong.
|
92
|
+
# Does not affect registerable.
|
93
|
+
# config.paranoid = true
|
94
|
+
|
95
|
+
# By default Devise will store the user in session. You can skip storage for
|
96
|
+
# particular strategies by setting this option.
|
97
|
+
# Notice that if you are skipping storage for all authentication paths, you
|
98
|
+
# may want to disable generating routes to Devise's sessions controller by
|
99
|
+
# passing skip: :sessions to `devise_for` in your config/routes.rb
|
100
|
+
config.skip_session_storage = [:http_auth]
|
101
|
+
|
102
|
+
# By default, Devise cleans up the CSRF token on authentication to
|
103
|
+
# avoid CSRF token fixation attacks. This means that, when using AJAX
|
104
|
+
# requests for sign in and sign up, you need to get a new CSRF token
|
105
|
+
# from the server. You can disable this option at your own risk.
|
106
|
+
# config.clean_up_csrf_token_on_authentication = true
|
107
|
+
|
108
|
+
# When false, Devise will not attempt to reload routes on eager load.
|
109
|
+
# This can reduce the time taken to boot the app but if your application
|
110
|
+
# requires the Devise mappings to be loaded during boot time the application
|
111
|
+
# won't boot properly.
|
112
|
+
# config.reload_routes = true
|
113
|
+
|
114
|
+
# ==> Configuration for :database_authenticatable
|
115
|
+
# For bcrypt, this is the cost for hashing the password and defaults to 12. If
|
116
|
+
# using other algorithms, it sets how many times you want the password to be hashed.
|
117
|
+
# The number of stretches used for generating the hashed password are stored
|
118
|
+
# with the hashed password. This allows you to change the stretches without
|
119
|
+
# invalidating existing passwords.
|
120
|
+
#
|
121
|
+
# Limiting the stretches to just one in testing will increase the performance of
|
122
|
+
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
123
|
+
# a value less than 10 in other environments. Note that, for bcrypt (the default
|
124
|
+
# algorithm), the cost increases exponentially with the number of stretches (e.g.
|
125
|
+
# a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
|
126
|
+
config.stretches = Rails.env.test? ? 1 : 12
|
127
|
+
|
128
|
+
# Set up a pepper to generate the hashed password.
|
129
|
+
# config.pepper = '3431514164be6e9a38dd387ae719d2ede1fb941348be4c5399f761d3256a59de83207d178f48b0cc6b531b362092905c34d2d87f4759509554bf203d3733ea8f'
|
130
|
+
|
131
|
+
# Send a notification to the original email when the user's email is changed.
|
132
|
+
# config.send_email_changed_notification = false
|
133
|
+
|
134
|
+
# Send a notification email when the user's password is changed.
|
135
|
+
# config.send_password_change_notification = false
|
136
|
+
|
137
|
+
# ==> Configuration for :confirmable
|
138
|
+
# A period that the user is allowed to access the website even without
|
139
|
+
# confirming their account. For instance, if set to 2.days, the user will be
|
140
|
+
# able to access the website for two days without confirming their account,
|
141
|
+
# access will be blocked just in the third day.
|
142
|
+
# You can also set it to nil, which will allow the user to access the website
|
143
|
+
# without confirming their account.
|
144
|
+
# Default is 0.days, meaning the user cannot access the website without
|
145
|
+
# confirming their account.
|
146
|
+
# config.allow_unconfirmed_access_for = 2.days
|
147
|
+
|
148
|
+
# A period that the user is allowed to confirm their account before their
|
149
|
+
# token becomes invalid. For example, if set to 3.days, the user can confirm
|
150
|
+
# their account within 3 days after the mail was sent, but on the fourth day
|
151
|
+
# their account can't be confirmed with the token any more.
|
152
|
+
# Default is nil, meaning there is no restriction on how long a user can take
|
153
|
+
# before confirming their account.
|
154
|
+
# config.confirm_within = 3.days
|
155
|
+
|
156
|
+
# If true, requires any email changes to be confirmed (exactly the same way as
|
157
|
+
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
158
|
+
# db field (see migrations). Until confirmed, new email is stored in
|
159
|
+
# unconfirmed_email column, and copied to email column on successful confirmation.
|
160
|
+
config.reconfirmable = true
|
161
|
+
|
162
|
+
# Defines which key will be used when confirming an account
|
163
|
+
# config.confirmation_keys = [:email]
|
164
|
+
|
165
|
+
# ==> Configuration for :rememberable
|
166
|
+
# The time the user will be remembered without asking for credentials again.
|
167
|
+
# config.remember_for = 2.weeks
|
168
|
+
|
169
|
+
# Invalidates all the remember me tokens when the user signs out.
|
170
|
+
config.expire_all_remember_me_on_sign_out = true
|
171
|
+
|
172
|
+
# If true, extends the user's remember period when remembered via cookie.
|
173
|
+
# config.extend_remember_period = false
|
174
|
+
|
175
|
+
# Options to be passed to the created cookie. For instance, you can set
|
176
|
+
# secure: true in order to force SSL only cookies.
|
177
|
+
# config.rememberable_options = {}
|
178
|
+
|
179
|
+
# ==> Configuration for :validatable
|
180
|
+
# Range for password length.
|
181
|
+
config.password_length = 6..128
|
182
|
+
|
183
|
+
# Email regex used to validate email formats. It simply asserts that
|
184
|
+
# one (and only one) @ exists in the given string. This is mainly
|
185
|
+
# to give user feedback and not to assert the e-mail validity.
|
186
|
+
config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
|
187
|
+
|
188
|
+
# ==> Configuration for :timeoutable
|
189
|
+
# The time you want to timeout the user session without activity. After this
|
190
|
+
# time the user will be asked for credentials again. Default is 30 minutes.
|
191
|
+
# config.timeout_in = 30.minutes
|
192
|
+
|
193
|
+
# ==> Configuration for :lockable
|
194
|
+
# Defines which strategy will be used to lock an account.
|
195
|
+
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
196
|
+
# :none = No lock strategy. You should handle locking by yourself.
|
197
|
+
# config.lock_strategy = :failed_attempts
|
198
|
+
|
199
|
+
# Defines which key will be used when locking and unlocking an account
|
200
|
+
# config.unlock_keys = [:email]
|
201
|
+
|
202
|
+
# Defines which strategy will be used to unlock an account.
|
203
|
+
# :email = Sends an unlock link to the user email
|
204
|
+
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
205
|
+
# :both = Enables both strategies
|
206
|
+
# :none = No unlock strategy. You should handle unlocking by yourself.
|
207
|
+
# config.unlock_strategy = :both
|
208
|
+
|
209
|
+
# Number of authentication tries before locking an account if lock_strategy
|
210
|
+
# is failed attempts.
|
211
|
+
# config.maximum_attempts = 20
|
212
|
+
|
213
|
+
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
214
|
+
# config.unlock_in = 1.hour
|
215
|
+
|
216
|
+
# Warn on the last attempt before the account is locked.
|
217
|
+
# config.last_attempt_warning = true
|
218
|
+
|
219
|
+
# ==> Configuration for :recoverable
|
220
|
+
#
|
221
|
+
# Defines which key will be used when recovering the password for an account
|
222
|
+
# config.reset_password_keys = [:email]
|
223
|
+
|
224
|
+
# Time interval you can reset your password with a reset password key.
|
225
|
+
# Don't put a too small interval or your users won't have the time to
|
226
|
+
# change their passwords.
|
227
|
+
config.reset_password_within = 6.hours
|
228
|
+
|
229
|
+
# When set to false, does not sign a user in automatically after their password is
|
230
|
+
# reset. Defaults to true, so a user is signed in automatically after a reset.
|
231
|
+
# config.sign_in_after_reset_password = true
|
232
|
+
|
233
|
+
# ==> Configuration for :encryptable
|
234
|
+
# Allow you to use another hashing or encryption algorithm besides bcrypt (default).
|
235
|
+
# You can use :sha1, :sha512 or algorithms from others authentication tools as
|
236
|
+
# :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
|
237
|
+
# for default behavior) and :restful_authentication_sha1 (then you should set
|
238
|
+
# stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
|
239
|
+
#
|
240
|
+
# Require the `devise-encryptable` gem when using anything other than bcrypt
|
241
|
+
# config.encryptor = :sha512
|
242
|
+
|
243
|
+
# ==> Scopes configuration
|
244
|
+
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
245
|
+
# "users/sessions/new". It's turned off by default because it's slower if you
|
246
|
+
# are using only default views.
|
247
|
+
# config.scoped_views = false
|
248
|
+
|
249
|
+
# Configure the default scope given to Warden. By default it's the first
|
250
|
+
# devise role declared in your routes (usually :user).
|
251
|
+
# config.default_scope = :user
|
252
|
+
|
253
|
+
# Set this configuration to false if you want /users/sign_out to sign out
|
254
|
+
# only the current scope. By default, Devise signs out all scopes.
|
255
|
+
# config.sign_out_all_scopes = true
|
256
|
+
|
257
|
+
# ==> Navigation configuration
|
258
|
+
# Lists the formats that should be treated as navigational. Formats like
|
259
|
+
# :html, should redirect to the sign in page when the user does not have
|
260
|
+
# access, but formats like :xml or :json, should return 401.
|
261
|
+
#
|
262
|
+
# If you have any extra navigational formats, like :iphone or :mobile, you
|
263
|
+
# should add them to the navigational formats lists.
|
264
|
+
#
|
265
|
+
# The "*/*" below is required to match Internet Explorer requests.
|
266
|
+
# config.navigational_formats = ['*/*', :html]
|
267
|
+
|
268
|
+
# The default HTTP method used to sign out a resource. Default is :delete.
|
269
|
+
config.sign_out_via = :delete
|
270
|
+
|
271
|
+
# ==> OmniAuth
|
272
|
+
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
273
|
+
# up on your models and hooks.
|
274
|
+
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
275
|
+
|
276
|
+
# ==> Warden configuration
|
277
|
+
# If you want to use other strategies, that are not supported by Devise, or
|
278
|
+
# change the failure app, you can configure them inside the config.warden block.
|
279
|
+
#
|
280
|
+
# config.warden do |manager|
|
281
|
+
# manager.intercept_401 = false
|
282
|
+
# manager.default_strategies(scope: :user).unshift :some_external_strategy
|
283
|
+
# end
|
284
|
+
|
285
|
+
# ==> Mountable engine configurations
|
286
|
+
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
|
287
|
+
# is mountable, there are some extra configurations to be taken into account.
|
288
|
+
# The following options are available, assuming the engine is mounted as:
|
289
|
+
#
|
290
|
+
# mount MyEngine, at: '/my_engine'
|
291
|
+
#
|
292
|
+
# The router that invoked `devise_for`, in the example above, would be:
|
293
|
+
# config.router_name = :my_engine
|
294
|
+
#
|
295
|
+
# When using OmniAuth, Devise cannot automatically set OmniAuth path,
|
296
|
+
# so you need to do it manually. For the users scope, it would be:
|
297
|
+
# config.omniauth_path_prefix = '/my_engine/users/auth'
|
298
|
+
|
299
|
+
# ==> Turbolinks configuration
|
300
|
+
# If your app is using Turbolinks, Turbolinks::Controller needs to be included to make redirection work correctly:
|
301
|
+
#
|
302
|
+
# ActiveSupport.on_load(:devise_failure_app) do
|
303
|
+
# include Turbolinks::Controller
|
304
|
+
# end
|
305
|
+
|
306
|
+
# ==> Configuration for :registerable
|
307
|
+
|
308
|
+
# When set to false, does not sign a user in automatically after their password is
|
309
|
+
# changed. Defaults to true, so a user is signed in automatically after changing a password.
|
310
|
+
# config.sign_in_after_change_password = true
|
311
|
+
# config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
|
312
|
+
|
313
|
+
config.jwt do |jwt|
|
314
|
+
jwt.secret = 'vjhgfdsfghjkhgfdsadfghgfds6h0l66sazxcvu76543456789oiuytresdfgyukjmh76f79oh43dv79gfrertyuuiufre56789iurydfgjrhew456yuyi76esdft5ew'
|
315
|
+
jwt.dispatch_requests = [
|
316
|
+
['POST', %r{^/api/login$}],
|
317
|
+
['POST', %r{^/api/login.json$}]
|
318
|
+
]
|
319
|
+
jwt.revocation_requests = [
|
320
|
+
['DELETE', %r{^/api/logout$}],
|
321
|
+
['DELETE', %r{^/api/logout.json$}]
|
322
|
+
]
|
323
|
+
jwt.expiration_time = 1.day.to_i
|
324
|
+
jwt.request_formats = { api_user: [:json] }
|
325
|
+
end
|
326
|
+
|
327
|
+
config.skip_session_storage = [:http_auth]
|
328
|
+
config.navigational_formats = ['*/*', :html, :json]
|
329
|
+
end
|
@@ -0,0 +1,16 @@
|
|
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
|
@@ -0,0 +1,11 @@
|
|
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
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Warden::JWTAuth.configure do |config|
|
2
|
+
config.secret = 'vjhgfdsfghjkhgfdsadfghgfds6h0l66sazxcvu76543456789oiuytresdfgyukjmh76f79oh43dv79gfrertyuuiufre56789iurydfgjrhew456yuyi76esdft5ew'
|
3
|
+
config.dispatch_requests = [
|
4
|
+
['POST', %r{^/api/login$}],
|
5
|
+
['POST', %r{^/api/login.json$}]
|
6
|
+
]
|
7
|
+
config.revocation_requests = [
|
8
|
+
['DELETE', %r{^/api/logout$}],
|
9
|
+
['DELETE', %r{^/api/logout.json$}]
|
10
|
+
]
|
11
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json]
|
9
|
+
end
|
10
|
+
|
11
|
+
# To enable root element in JSON for ActiveRecord objects.
|
12
|
+
# ActiveSupport.on_load(:active_record) do
|
13
|
+
# self.include_root_in_json = true
|
14
|
+
# end
|
@@ -0,0 +1,65 @@
|
|
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:"
|
@@ -0,0 +1,33 @@
|
|
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"
|
data/config/master.key
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
c6f375578f0e905477b3f18f0778af29
|
data/config/puma.rb
ADDED
@@ -0,0 +1,43 @@
|
|
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 `rails restart` command.
|
43
|
+
plugin :tmp_restart
|
data/config/routes.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
Rails.application.routes.draw do
|
2
|
+
devise_for :tests
|
3
|
+
root to: "home#index"
|
4
|
+
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
|
5
|
+
|
6
|
+
devise_for :users, defaults: { format: :html },
|
7
|
+
path: '',
|
8
|
+
path_names: { sign_up: 'register' },
|
9
|
+
controllers: {
|
10
|
+
sessions: 'sessions',
|
11
|
+
registrations: 'registrations',
|
12
|
+
confirmations: 'confirmations'
|
13
|
+
}
|
14
|
+
devise_scope :user do
|
15
|
+
get 'sign_in', to: 'devise/sessions#new'
|
16
|
+
get 'register', to: 'devise/registrations#new'
|
17
|
+
post 'register', to: 'devise/registrations#create'
|
18
|
+
delete 'sign_out', to: 'devise/sessions#destroy'
|
19
|
+
get 'confirmation/sent', to: 'confirmations#sent'
|
20
|
+
get 'confirmation/:confirmation_token', to: 'confirmations#show'
|
21
|
+
patch 'confirmation', to: 'confirmations#create'
|
22
|
+
end
|
23
|
+
# API namespace, for JSON requests at /api/sign_[in|out]
|
24
|
+
namespace :api do
|
25
|
+
devise_for :users, defaults: { format: :json },
|
26
|
+
class_name: 'ApiUser',
|
27
|
+
skip: [:registrations, :invitations,
|
28
|
+
:passwords, :confirmations,
|
29
|
+
:unlocks],
|
30
|
+
path: '',
|
31
|
+
path_names: { sign_in: 'login',
|
32
|
+
sign_out: 'logout' }
|
33
|
+
devise_scope :user do
|
34
|
+
get 'login', to: 'sessions#new'
|
35
|
+
# post 'login', to: 'sessions#new'
|
36
|
+
delete 'logout', to: 'devise/sessions#destroy'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
data/config/spring.rb
ADDED
data/config/storage.yml
ADDED
@@ -0,0 +1,34 @@
|
|
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 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
|
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
|
23
|
+
|
24
|
+
# Use 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
|
30
|
+
|
31
|
+
# mirror:
|
32
|
+
# service: Mirror
|
33
|
+
# primary: local
|
34
|
+
# mirrors: [ amazon, google, microsoft ]
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# Note: You must restart bin/webpack-dev-server for changes to take effect
|
2
|
+
|
3
|
+
default: &default
|
4
|
+
source_path: app/javascript
|
5
|
+
source_entry_path: packs
|
6
|
+
public_root_path: public
|
7
|
+
public_output_path: packs
|
8
|
+
cache_path: tmp/cache/webpacker
|
9
|
+
webpack_compile_output: true
|
10
|
+
|
11
|
+
# Additional paths webpack should lookup modules
|
12
|
+
# ['app/assets', 'engine/foo/app/assets']
|
13
|
+
additional_paths: []
|
14
|
+
|
15
|
+
# Reload manifest.json on all requests so we reload latest compiled packs
|
16
|
+
cache_manifest: false
|
17
|
+
|
18
|
+
# Extract and emit a css file
|
19
|
+
extract_css: false
|
20
|
+
|
21
|
+
static_assets_extensions:
|
22
|
+
- .jpg
|
23
|
+
- .jpeg
|
24
|
+
- .png
|
25
|
+
- .gif
|
26
|
+
- .tiff
|
27
|
+
- .ico
|
28
|
+
- .svg
|
29
|
+
- .eot
|
30
|
+
- .otf
|
31
|
+
- .ttf
|
32
|
+
- .woff
|
33
|
+
- .woff2
|
34
|
+
|
35
|
+
extensions:
|
36
|
+
- .mjs
|
37
|
+
- .js
|
38
|
+
- .sass
|
39
|
+
- .scss
|
40
|
+
- .css
|
41
|
+
- .module.sass
|
42
|
+
- .module.scss
|
43
|
+
- .module.css
|
44
|
+
- .png
|
45
|
+
- .svg
|
46
|
+
- .gif
|
47
|
+
- .jpeg
|
48
|
+
- .jpg
|
49
|
+
|
50
|
+
development:
|
51
|
+
<<: *default
|
52
|
+
compile: true
|
53
|
+
|
54
|
+
# Reference: https://webpack.js.org/configuration/dev-server/
|
55
|
+
dev_server:
|
56
|
+
https: false
|
57
|
+
host: localhost
|
58
|
+
port: 3035
|
59
|
+
public: localhost:3035
|
60
|
+
hmr: false
|
61
|
+
# Inline should be set to true if using HMR
|
62
|
+
inline: true
|
63
|
+
overlay: true
|
64
|
+
compress: true
|
65
|
+
disable_host_check: true
|
66
|
+
use_local_ip: false
|
67
|
+
quiet: false
|
68
|
+
pretty: false
|
69
|
+
headers:
|
70
|
+
'Access-Control-Allow-Origin': '*'
|
71
|
+
watch_options:
|
72
|
+
ignored: '**/node_modules/**'
|
73
|
+
|
74
|
+
|
75
|
+
test:
|
76
|
+
<<: *default
|
77
|
+
compile: true
|
78
|
+
|
79
|
+
# Compile test packs to a separate directory
|
80
|
+
public_output_path: packs-test
|
81
|
+
|
82
|
+
production:
|
83
|
+
<<: *default
|
84
|
+
|
85
|
+
# Production depends on precompilation of packs prior to booting for performance.
|
86
|
+
compile: false
|
87
|
+
|
88
|
+
# Extract and emit a css file
|
89
|
+
extract_css: true
|
90
|
+
|
91
|
+
# Cache manifest.json for performance
|
92
|
+
cache_manifest: true
|
data/devise_jwt.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.license = 'MIT'
|
13
13
|
s.platform = Gem::Platform::RUBY
|
14
14
|
|
15
|
-
s.files = Dir["{lib}/**/*", 'README.md', 'LICENSE', 'devise_jwt.gemspec', 'Gemfile']
|
15
|
+
s.files = Dir["{lib,config}/**/*", 'README.md', 'LICENSE', 'devise_jwt.gemspec', 'Gemfile']
|
16
16
|
s.require_paths = ["lib"]
|
17
17
|
# s.add_dependency 'test', ~> '2.1' #install during runtime
|
18
18
|
# s.add_development_dependency 'rspec', ~> '1.6'
|
data/lib/devise_jwt/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_jwt_mehak
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mehak Singla
|
@@ -19,6 +19,39 @@ files:
|
|
19
19
|
- Gemfile
|
20
20
|
- LICENSE
|
21
21
|
- README.md
|
22
|
+
- config/application.rb
|
23
|
+
- config/boot.rb
|
24
|
+
- config/cable.yml
|
25
|
+
- config/credentials.yml.enc
|
26
|
+
- config/database.yml
|
27
|
+
- config/environment.rb
|
28
|
+
- config/environments/development.rb
|
29
|
+
- config/environments/production.rb
|
30
|
+
- config/environments/test.rb
|
31
|
+
- config/initializers/application_controller_renderer.rb
|
32
|
+
- config/initializers/assets.rb
|
33
|
+
- config/initializers/backtrace_silencers.rb
|
34
|
+
- config/initializers/content_security_policy.rb
|
35
|
+
- config/initializers/cookies_serializer.rb
|
36
|
+
- config/initializers/devise.rb
|
37
|
+
- config/initializers/filter_parameter_logging.rb
|
38
|
+
- config/initializers/inflections.rb
|
39
|
+
- config/initializers/mime_types.rb
|
40
|
+
- config/initializers/permissions_policy.rb
|
41
|
+
- config/initializers/warden_auth.rb
|
42
|
+
- config/initializers/wrap_parameters.rb
|
43
|
+
- config/locales/devise.en.yml
|
44
|
+
- config/locales/en.yml
|
45
|
+
- config/master.key
|
46
|
+
- config/puma.rb
|
47
|
+
- config/routes.rb
|
48
|
+
- config/spring.rb
|
49
|
+
- config/storage.yml
|
50
|
+
- config/webpack/development.js
|
51
|
+
- config/webpack/environment.js
|
52
|
+
- config/webpack/production.js
|
53
|
+
- config/webpack/test.js
|
54
|
+
- config/webpacker.yml
|
22
55
|
- devise_jwt.gemspec
|
23
56
|
- lib/devise_jwt.rb
|
24
57
|
- lib/devise_jwt/version.rb
|