cms-fortress 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/.rbenv-gemsets +1 -0
  2. data/.ruby-version +1 -0
  3. data/Gemfile +4 -3
  4. data/Gemfile.lock +146 -105
  5. data/README.rdoc +3 -2
  6. data/VERSION +1 -1
  7. data/app/assets/stylesheets/cms/fortress/admin_overrides.css +5 -0
  8. data/app/controllers/cms/fortress/admin_controller.rb +1 -1
  9. data/app/controllers/cms/fortress/roles_controller.rb +11 -3
  10. data/app/controllers/cms/fortress/users_controller.rb +1 -1
  11. data/app/models/cms/fortress/role.rb +3 -2
  12. data/app/models/cms/fortress/role_detail.rb +3 -2
  13. data/app/models/cms/fortress/user.rb +5 -2
  14. data/app/models/cms/page_workflow.rb +27 -0
  15. data/app/views/.DS_Store +0 -0
  16. data/app/views/admin/cms/pages/_form.html.haml +61 -0
  17. data/app/views/admin/cms/partials/_body_before.html.haml +1 -0
  18. data/app/views/cms/fortress/shared/_admin_topnav.html.haml +4 -4
  19. data/app/views/cms/fortress/users/sessions/.DS_Store +0 -0
  20. data/app/views/cms/fortress/users/sessions/new.html.haml +11 -0
  21. data/app/views/layouts/admin/_body.html.haml +17 -0
  22. data/app/views/layouts/admin/cms/.DS_Store +0 -0
  23. data/app/views/layouts/{cms_admin → admin/cms}/_head.html.haml +2 -2
  24. data/app/views/layouts/admin/cms/_left.html.haml +23 -0
  25. data/cms-fortress.gemspec +33 -18
  26. data/config/roles.yml +2 -0
  27. data/db/migrate/04_create_cms_page_workflows.rb +11 -0
  28. data/lib/cms-fortress.rb +8 -5
  29. data/lib/cms/fortress/application_controller_methods.rb +2 -2
  30. data/lib/cms/fortress/auth.rb +2 -2
  31. data/lib/cms/fortress/comfortable_mexican_sofa.rb +1 -0
  32. data/lib/cms/fortress/content_renderer.rb +30 -0
  33. data/lib/cms/fortress/page_methods.rb +17 -0
  34. data/lib/cms/fortress/rails/engine.rb +4 -0
  35. data/lib/cms/fortress/routes/admin.rb +21 -0
  36. data/lib/cms/fortress/routing.rb +1 -0
  37. data/lib/generators/cms/fortress/fortress_generator.rb +4 -0
  38. data/lib/generators/comfy/cms/cms_generator.rb +17 -12
  39. data/test/fixtures/cms/page_workflows.yml +11 -0
  40. metadata +99 -31
  41. data/app/views/cms_users/sessions/new.html.erb +0 -19
  42. data/app/views/layouts/cms_admin/_body.html.haml +0 -22
  43. data/app/views/layouts/cms_admin/_left.html.haml +0 -18
  44. data/config/initializers/devise.rb +0 -243
  45. data/config/routes.rb +0 -34
@@ -0,0 +1,21 @@
1
+ class ActionDispatch::Routing::Mapper
2
+
3
+ def cms_fortress_routes(options = {})
4
+ path = options[:path] || "cms-admin"
5
+
6
+ devise_for "cms/fortress/users", :path => path, :path_names => {
7
+ :sign_in => 'login', :sign_out => 'logout'
8
+ }
9
+
10
+ scope path, module: 'cms/fortress' do
11
+ resources :roles, :as => 'cms_fortress_roles'
12
+ resources :users, :as => 'cms_fortress_users'
13
+
14
+ get 'settings' => 'admin#settings', :as => 'cms_fortress_settings'
15
+ get 'design' => 'admin#design', :as => 'cms_fortress_design'
16
+ get 'settings/users' => 'admin#users', :as => 'cms_fortress_user_settings'
17
+
18
+ end
19
+
20
+ end
21
+ end
@@ -0,0 +1 @@
1
+ require_relative 'routes/admin'
@@ -2,6 +2,10 @@
2
2
  class Cms::FortressGenerator < Rails::Generators::Base
3
3
  source_root File.expand_path('../templates', __FILE__)
4
4
 
5
+ def install_devise
6
+ generate("devise:install")
7
+ end
8
+
5
9
  def install_comfortable_mexican_sofa
6
10
  generate("comfy:cms")
7
11
  end
@@ -1,13 +1,14 @@
1
+ require 'rails/generators/active_record'
2
+
1
3
  module Comfy
2
4
  module Generators
3
5
  class CmsGenerator < Rails::Generators::Base
4
6
 
5
- require 'rails/generators/active_record'
6
7
  include Rails::Generators::Migration
7
8
  include Thor::Actions
8
9
 
9
10
  spec = Gem::Specification.find_by_name("comfortable_mexican_sofa")
10
- source_root spec.gem_dir # File.expand_path('../../../../..', __FILE__)
11
+ source_root spec.gem_dir # File.expand_path('../../../../..', __FILE__)
11
12
 
12
13
  def generate_migration
13
14
  destination = File.expand_path('db/migrate/01_create_cms.rb', self.destination_root)
@@ -25,20 +26,25 @@ module Comfy
25
26
  copy_file 'config/initializers/comfortable_mexican_sofa.rb',
26
27
  'config/initializers/comfortable_mexican_sofa.rb'
27
28
  end
28
-
29
- =begin
29
+
30
30
  def generate_routing
31
- route "
32
- ComfortableMexicanSofa::Routing.admin(:path => '/cms-admin')
33
-
34
- # Make sure this routeset is defined last
35
- ComfortableMexicanSofa::Routing.content(:path => '/', :sitemap => false)"
31
+ route_string = " cms_fortress_routes :path => '/cms-admin'\n"
32
+ route_string << " comfy_route :cms_admin, :path => '/cms-admin'\n\n"
33
+ route_string << " # Make sure this routeset is defined last\n"
34
+ route_string << " comfy_route :cms, :path => '/', :sitemap => false\n"
35
+ route route_string[2..-1]
36
36
  end
37
- =end
38
-
37
+
39
38
  def generate_cms_seeds
40
39
  directory 'db/cms_fixtures', 'db/cms_fixtures'
41
40
  end
41
+
42
+ def generate_assets
43
+ directory 'app/assets/javascripts/comfortable_mexican_sofa/admin',
44
+ 'app/assets/javascripts/comfortable_mexican_sofa/admin'
45
+ directory 'app/assets/stylesheets/comfortable_mexican_sofa/admin',
46
+ 'app/assets/stylesheets/comfortable_mexican_sofa/admin'
47
+ end
42
48
 
43
49
  =begin
44
50
  def show_readme
@@ -52,4 +58,3 @@ module Comfy
52
58
  end
53
59
  end
54
60
  end
55
-
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ one:
4
+ cms_page_id: 1
5
+ status_id: 1
6
+ published_date: 2013-12-07 11:59:36
7
+
8
+ two:
9
+ cms_page_id: 1
10
+ status_id: 1
11
+ published_date: 2013-12-07 11:59:36
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cms-fortress
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,44 +9,59 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-01 00:00:00.000000000 Z
12
+ date: 2013-12-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70337317284160 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: '0'
21
+ version: 4.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70337317284160
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 4.0.0
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: comfortable_mexican_sofa
27
- requirement: &70337317282320 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
- - - =
35
+ - - ~>
31
36
  - !ruby/object:Gem::Version
32
- version: 1.8.1
37
+ version: '1.11'
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *70337317282320
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '1.11'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: devise
38
- requirement: &70337317280580 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
- - - ! '>='
51
+ - - ~>
42
52
  - !ruby/object:Gem::Version
43
- version: 1.5.4
53
+ version: '3.2'
44
54
  type: :runtime
45
55
  prerelease: false
46
- version_requirements: *70337317280580
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '3.2'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: cancan
49
- requirement: &70337317278940 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ! '>='
@@ -54,10 +69,31 @@ dependencies:
54
69
  version: 1.6.9
55
70
  type: :runtime
56
71
  prerelease: false
57
- version_requirements: *70337317278940
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: 1.6.9
78
+ - !ruby/object:Gem::Dependency
79
+ name: delayed_job
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: '4'
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: '4'
58
94
  - !ruby/object:Gem::Dependency
59
95
  name: rdoc
60
- requirement: &70337317252620 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
61
97
  none: false
62
98
  requirements:
63
99
  - - ! '>='
@@ -65,10 +101,15 @@ dependencies:
65
101
  version: '0'
66
102
  type: :development
67
103
  prerelease: false
68
- version_requirements: *70337317252620
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
69
110
  - !ruby/object:Gem::Dependency
70
111
  name: bundler
71
- requirement: &70337317251380 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
72
113
  none: false
73
114
  requirements:
74
115
  - - ! '>='
@@ -76,10 +117,15 @@ dependencies:
76
117
  version: '0'
77
118
  type: :development
78
119
  prerelease: false
79
- version_requirements: *70337317251380
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
80
126
  - !ruby/object:Gem::Dependency
81
127
  name: jeweler
82
- requirement: &70337317248840 !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
83
129
  none: false
84
130
  requirements:
85
131
  - - ! '>='
@@ -87,10 +133,15 @@ dependencies:
87
133
  version: '0'
88
134
  type: :development
89
135
  prerelease: false
90
- version_requirements: *70337317248840
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
91
142
  - !ruby/object:Gem::Dependency
92
143
  name: simplecov
93
- requirement: &70337317224040 !ruby/object:Gem::Requirement
144
+ requirement: !ruby/object:Gem::Requirement
94
145
  none: false
95
146
  requirements:
96
147
  - - ! '>='
@@ -98,7 +149,12 @@ dependencies:
98
149
  version: '0'
99
150
  type: :development
100
151
  prerelease: false
101
- version_requirements: *70337317224040
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
102
158
  description: Comfortable Mexican Sofa (CMS) - User and role management extension
103
159
  email: melvinsembrano@gmail.com
104
160
  executables: []
@@ -108,6 +164,8 @@ extra_rdoc_files:
108
164
  - README.rdoc
109
165
  files:
110
166
  - .document
167
+ - .rbenv-gemsets
168
+ - .ruby-version
111
169
  - .rvmrc
112
170
  - Gemfile
113
171
  - Gemfile.lock
@@ -144,7 +202,11 @@ files:
144
202
  - app/models/cms/fortress/role.rb
145
203
  - app/models/cms/fortress/role_detail.rb
146
204
  - app/models/cms/fortress/user.rb
205
+ - app/models/cms/page_workflow.rb
147
206
  - app/models/cms_ability.rb
207
+ - app/views/.DS_Store
208
+ - app/views/admin/cms/pages/_form.html.haml
209
+ - app/views/admin/cms/partials/_body_before.html.haml
148
210
  - app/views/cms/fortress/admin/design.html.haml
149
211
  - app/views/cms/fortress/admin/roles.html.haml
150
212
  - app/views/cms/fortress/admin/settings.html.haml
@@ -160,32 +222,38 @@ files:
160
222
  - app/views/cms/fortress/users/edit.html.haml
161
223
  - app/views/cms/fortress/users/index.html.haml
162
224
  - app/views/cms/fortress/users/new.html.haml
163
- - app/views/cms_users/sessions/new.html.erb
225
+ - app/views/cms/fortress/users/sessions/.DS_Store
226
+ - app/views/cms/fortress/users/sessions/new.html.haml
227
+ - app/views/layouts/admin/_body.html.haml
228
+ - app/views/layouts/admin/cms/.DS_Store
229
+ - app/views/layouts/admin/cms/_head.html.haml
230
+ - app/views/layouts/admin/cms/_left.html.haml
164
231
  - app/views/layouts/cms/fortress/default.html.erb
165
232
  - app/views/layouts/cms/fortress/session.html.erb
166
- - app/views/layouts/cms_admin/_body.html.haml
167
- - app/views/layouts/cms_admin/_head.html.haml
168
- - app/views/layouts/cms_admin/_left.html.haml
169
233
  - cms-fortress.gemspec
170
- - config/initializers/devise.rb
171
234
  - config/locales/en.yml
172
235
  - config/roles.yml
173
- - config/routes.rb
174
236
  - db/migrate/01_devise_create_cms_fortress_users.rb
175
237
  - db/migrate/02_create_cms_fortress_role_details.rb
176
238
  - db/migrate/03_create_cms_fortress_roles.rb
239
+ - db/migrate/04_create_cms_page_workflows.rb
177
240
  - lib/cms-fortress.rb
178
241
  - lib/cms/fortress/application_controller_methods.rb
179
242
  - lib/cms/fortress/auth.rb
180
243
  - lib/cms/fortress/comfortable_mexican_sofa.rb
244
+ - lib/cms/fortress/content_renderer.rb
181
245
  - lib/cms/fortress/devise.rb
246
+ - lib/cms/fortress/page_methods.rb
182
247
  - lib/cms/fortress/rails/engine.rb
248
+ - lib/cms/fortress/routes/admin.rb
249
+ - lib/cms/fortress/routing.rb
183
250
  - lib/generators/cms/fortress/USAGE
184
251
  - lib/generators/cms/fortress/fortress_generator.rb
185
252
  - lib/generators/cms/fortress/templates/README
186
253
  - lib/generators/comfy/cms/cms_generator.rb
187
254
  - test/fixtures/cms/fortress/role_details.yml
188
255
  - test/fixtures/cms/fortress/roles.yml
256
+ - test/fixtures/cms/page_workflows.yml
189
257
  - test/functional/cms/fortress/roles_controller_test.rb
190
258
  - test/functional/cms/fortress/users_controller_test.rb
191
259
  - test/helper.rb
@@ -210,7 +278,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
210
278
  version: '0'
211
279
  segments:
212
280
  - 0
213
- hash: -3749172263234487862
281
+ hash: -2800904280739385150
214
282
  required_rubygems_version: !ruby/object:Gem::Requirement
215
283
  none: false
216
284
  requirements:
@@ -219,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
287
  version: '0'
220
288
  requirements: []
221
289
  rubyforge_project:
222
- rubygems_version: 1.8.10
290
+ rubygems_version: 1.8.23
223
291
  signing_key:
224
292
  specification_version: 3
225
293
  summary: Comfortable Mexican Sofa (CMS) - User and role management extension
@@ -1,19 +0,0 @@
1
- <%= render :partial => 'cms/fortress/shared/navbar' %>
2
-
3
- <%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => "form-signin" }) do |f| %>
4
- <h3 class="form-signin-heading">Sign in</h3>
5
-
6
- <%= f.email_field :email, :autofocus => true, :placeholder => "Email address", :class => "input-block-level" %>
7
- <%= f.password_field :password, :placeholder => "Password", :class => "input-block-level" %>
8
-
9
- <% if devise_mapping.rememberable? -%>
10
- <label class="checkbox">
11
- <%= f.check_box :remember_me %> Remember me
12
- </label>
13
- <% end -%>
14
-
15
- <%= f.submit "Sign in", :class => "btn btn-primary" %>
16
-
17
- <%= render "devise/shared/links" %>
18
- <% end %>
19
-
@@ -1,22 +0,0 @@
1
- %body#comfy{:class => "c-#{params[:controller].slugify} a-#{params[:action].slugify}"}
2
- = cms_hook :header
3
-
4
- .body-wrapper
5
- .left-column
6
- .left-column-content
7
- = render :partial => 'layouts/cms_admin/left'
8
- .right-column
9
- .right-column-content
10
- = render :partial => 'layouts/cms_admin/right'
11
- .center-column
12
- = render :partial => 'layouts/cms_admin/center'
13
-
14
- #footer
15
- .footer-container
16
- %p.muted.credit
17
- Powered by:
18
- = link_to('ComfortableMexicanSofa', 'https://github.com/confy', :target => '_blank')
19
- %span.version= ComfortableMexicanSofa::VERSION
20
-
21
-
22
-
@@ -1,18 +0,0 @@
1
- %ul.navigation
2
-
3
- - if admin_page?
4
- %li= active_link_to t('cms_admin.base.sites'), cms_admin_sites_path, :active => ['cms_admin/sites']
5
- %li= active_link_to t('cms.fortress.roles.title'), cms_fortress_roles_path
6
- %li= active_link_to t('cms.fortress.users.title'), cms_fortress_users_path
7
- - elsif design_page?
8
- - if @site && !@site.new_record?
9
- %li= active_link_to t('cms_admin.base.layouts'), cms_admin_site_layouts_path(@site)
10
- %li= active_link_to t('cms_admin.base.snippets'), cms_admin_site_snippets_path(@site)
11
-
12
- = cms_hook :design_navigation
13
- - else
14
- - if @site && !@site.new_record?
15
- %li= active_link_to t('cms_admin.base.pages'), cms_admin_site_pages_path(@site)
16
- %li= active_link_to t('cms_admin.base.files'), cms_admin_site_files_path(@site)
17
-
18
- = cms_hook :navigation
@@ -1,243 +0,0 @@
1
- if defined?(Devise)
2
-
3
- # Use this hook to configure devise mailer, warden hooks and so forth.
4
- # Many of these configuration options can be set straight in your model.
5
- Devise.setup do |config|
6
- # ==> Mailer Configuration
7
- # Configure the e-mail address which will be shown in Devise::Mailer,
8
- # note that it will be overwritten if you use your own mailer class with default "from" parameter.
9
- config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
10
-
11
- # Configure the class responsible to send e-mails.
12
- # config.mailer = "Devise::Mailer"
13
-
14
- # ==> ORM configuration
15
- # Load and configure the ORM. Supports :active_record (default) and
16
- # :mongoid (bson_ext recommended) by default. Other ORMs may be
17
- # available as additional gems.
18
- require 'devise/orm/active_record'
19
-
20
- # ==> Configuration for any authentication mechanism
21
- # Configure which keys are used when authenticating a user. The default is
22
- # just :email. You can configure it to use [:username, :subdomain], so for
23
- # authenticating a user, both parameters are required. Remember that those
24
- # parameters are used only when authenticating and not when retrieving from
25
- # session. If you need permissions, you should implement that in a before filter.
26
- # You can also supply a hash where the value is a boolean determining whether
27
- # or not authentication should be aborted when the value is not present.
28
- # config.authentication_keys = [ :email ]
29
-
30
- # Configure parameters from the request object used for authentication. Each entry
31
- # given should be a request method and it will automatically be passed to the
32
- # find_for_authentication method and considered in your model lookup. For instance,
33
- # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
34
- # The same considerations mentioned for authentication_keys also apply to request_keys.
35
- # config.request_keys = []
36
-
37
- # Configure which authentication keys should be case-insensitive.
38
- # These keys will be downcased upon creating or modifying a user and when used
39
- # to authenticate or find a user. Default is :email.
40
- config.case_insensitive_keys = [ :email ]
41
-
42
- # Configure which authentication keys should have whitespace stripped.
43
- # These keys will have whitespace before and after removed upon creating or
44
- # modifying a user and when used to authenticate or find a user. Default is :email.
45
- config.strip_whitespace_keys = [ :email ]
46
-
47
- # Tell if authentication through request.params is enabled. True by default.
48
- # It can be set to an array that will enable params authentication only for the
49
- # given strategies, for example, `config.params_authenticatable = [:database]` will
50
- # enable it only for database (email + password) authentication.
51
- # config.params_authenticatable = true
52
-
53
- # Tell if authentication through HTTP Basic Auth is enabled. False by default.
54
- # It can be set to an array that will enable http authentication only for the
55
- # given strategies, for example, `config.http_authenticatable = [:token]` will
56
- # enable it only for token authentication.
57
- # config.http_authenticatable = false
58
-
59
- # If http headers should be returned for AJAX requests. True by default.
60
- # config.http_authenticatable_on_xhr = true
61
-
62
- # The realm used in Http Basic Authentication. "Application" by default.
63
- # config.http_authentication_realm = "Application"
64
-
65
- # It will change confirmation, password recovery and other workflows
66
- # to behave the same regardless if the e-mail provided was right or wrong.
67
- # Does not affect registerable.
68
- # config.paranoid = true
69
-
70
- # By default Devise will store the user in session. You can skip storage for
71
- # :http_auth and :token_auth by adding those symbols to the array below.
72
- # Notice that if you are skipping storage for all authentication paths, you
73
- # may want to disable generating routes to Devise's sessions controller by
74
- # passing :skip => :sessions to `devise_for` in your config/routes.rb
75
- config.skip_session_storage = [:http_auth]
76
-
77
- # ==> Configuration for :database_authenticatable
78
- # For bcrypt, this is the cost for hashing the password and defaults to 10. If
79
- # using other encryptors, it sets how many times you want the password re-encrypted.
80
- #
81
- # Limiting the stretches to just one in testing will increase the performance of
82
- # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
83
- # a value less than 10 in other environments.
84
- config.stretches = Rails.env.test? ? 1 : 10
85
-
86
- # Setup a pepper to generate the encrypted password.
87
- # config.pepper = "3c78466023e3c2ec2e436cf7237ed5aa5eb70b438b187c43d2c391c5adb7b1ea552ac1176e18d3890b9771801e6e580188f02e93bade6840c5f736166f3953b9"
88
-
89
- # ==> Configuration for :confirmable
90
- # A period that the user is allowed to access the website even without
91
- # confirming his account. For instance, if set to 2.days, the user will be
92
- # able to access the website for two days without confirming his account,
93
- # access will be blocked just in the third day. Default is 0.days, meaning
94
- # the user cannot access the website without confirming his account.
95
- # config.allow_unconfirmed_access_for = 2.days
96
-
97
- # A period that the user is allowed to confirm their account before their
98
- # token becomes invalid. For example, if set to 3.days, the user can confirm
99
- # their account within 3 days after the mail was sent, but on the fourth day
100
- # their account can't be confirmed with the token any more.
101
- # Default is nil, meaning there is no restriction on how long a user can take
102
- # before confirming their account.
103
- # config.confirm_within = 3.days
104
-
105
- # If true, requires any email changes to be confirmed (exactly the same way as
106
- # initial account confirmation) to be applied. Requires additional unconfirmed_email
107
- # db field (see migrations). Until confirmed new email is stored in
108
- # unconfirmed email column, and copied to email column on successful confirmation.
109
- config.reconfirmable = true
110
-
111
- # Defines which key will be used when confirming an account
112
- # config.confirmation_keys = [ :email ]
113
-
114
- # ==> Configuration for :rememberable
115
- # The time the user will be remembered without asking for credentials again.
116
- # config.remember_for = 2.weeks
117
-
118
- # If true, extends the user's remember period when remembered via cookie.
119
- # config.extend_remember_period = false
120
-
121
- # Options to be passed to the created cookie. For instance, you can set
122
- # :secure => true in order to force SSL only cookies.
123
- # config.rememberable_options = {}
124
-
125
- # ==> Configuration for :validatable
126
- # Range for password length. Default is 8..128.
127
- config.password_length = 8..128
128
-
129
- # Email regex used to validate email formats. It simply asserts that
130
- # an one (and only one) @ exists in the given string. This is mainly
131
- # to give user feedback and not to assert the e-mail validity.
132
- # config.email_regexp = /\A[^@]+@[^@]+\z/
133
-
134
- # ==> Configuration for :timeoutable
135
- # The time you want to timeout the user session without activity. After this
136
- # time the user will be asked for credentials again. Default is 30 minutes.
137
- # config.timeout_in = 30.minutes
138
-
139
- # If true, expires auth token on session timeout.
140
- # config.expire_auth_token_on_timeout = false
141
-
142
- # ==> Configuration for :lockable
143
- # Defines which strategy will be used to lock an account.
144
- # :failed_attempts = Locks an account after a number of failed attempts to sign in.
145
- # :none = No lock strategy. You should handle locking by yourself.
146
- # config.lock_strategy = :failed_attempts
147
-
148
- # Defines which key will be used when locking and unlocking an account
149
- # config.unlock_keys = [ :email ]
150
-
151
- # Defines which strategy will be used to unlock an account.
152
- # :email = Sends an unlock link to the user email
153
- # :time = Re-enables login after a certain amount of time (see :unlock_in below)
154
- # :both = Enables both strategies
155
- # :none = No unlock strategy. You should handle unlocking by yourself.
156
- # config.unlock_strategy = :both
157
-
158
- # Number of authentication tries before locking an account if lock_strategy
159
- # is failed attempts.
160
- # config.maximum_attempts = 20
161
-
162
- # Time interval to unlock the account if :time is enabled as unlock_strategy.
163
- # config.unlock_in = 1.hour
164
-
165
- # ==> Configuration for :recoverable
166
- #
167
- # Defines which key will be used when recovering the password for an account
168
- # config.reset_password_keys = [ :email ]
169
-
170
- # Time interval you can reset your password with a reset password key.
171
- # Don't put a too small interval or your users won't have the time to
172
- # change their passwords.
173
- config.reset_password_within = 6.hours
174
-
175
- # ==> Configuration for :encryptable
176
- # Allow you to use another encryption algorithm besides bcrypt (default). You can use
177
- # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
178
- # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
179
- # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
180
- # REST_AUTH_SITE_KEY to pepper)
181
- # config.encryptor = :sha512
182
-
183
- # ==> Configuration for :token_authenticatable
184
- # Defines name of the authentication token params key
185
- # config.token_authentication_key = :auth_token
186
-
187
- # ==> Scopes configuration
188
- # Turn scoped views on. Before rendering "sessions/new", it will first check for
189
- # "users/sessions/new". It's turned off by default because it's slower if you
190
- # are using only default views.
191
- # config.scoped_views = false
192
-
193
- # Configure the default scope given to Warden. By default it's the first
194
- # devise role declared in your routes (usually :user).
195
- # config.default_scope = :user
196
-
197
- # Set this configuration to false if you want /users/sign_out to sign out
198
- # only the current scope. By default, Devise signs out all scopes.
199
- # config.sign_out_all_scopes = true
200
-
201
- # ==> Navigation configuration
202
- # Lists the formats that should be treated as navigational. Formats like
203
- # :html, should redirect to the sign in page when the user does not have
204
- # access, but formats like :xml or :json, should return 401.
205
- #
206
- # If you have any extra navigational formats, like :iphone or :mobile, you
207
- # should add them to the navigational formats lists.
208
- #
209
- # The "*/*" below is required to match Internet Explorer requests.
210
- # config.navigational_formats = ["*/*", :html]
211
-
212
- # The default HTTP method used to sign out a resource. Default is :delete.
213
- config.sign_out_via = :delete
214
-
215
- # ==> OmniAuth
216
- # Add a new OmniAuth provider. Check the wiki for more information on setting
217
- # up on your models and hooks.
218
- # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
219
-
220
- # ==> Warden configuration
221
- # If you want to use other strategies, that are not supported by Devise, or
222
- # change the failure app, you can configure them inside the config.warden block.
223
- #
224
- # config.warden do |manager|
225
- # manager.intercept_401 = false
226
- # manager.default_strategies(:scope => :user).unshift :some_external_strategy
227
- # end
228
-
229
- # ==> Mountable engine configurations
230
- # When using Devise inside an engine, let's call it `MyEngine`, and this engine
231
- # is mountable, there are some extra configurations to be taken into account.
232
- # The following options are available, assuming the engine is mounted as:
233
- #
234
- # mount MyEngine, at: "/my_engine"
235
- #
236
- # The router that invoked `devise_for`, in the example above, would be:
237
- # config.router_name = :my_engine
238
- #
239
- # When using omniauth, Devise cannot automatically set Omniauth path,
240
- # so you need to do it manually. For the users scope, it would be:
241
- # config.omniauth_path_prefix = "/my_engine/users/auth"
242
- end
243
- end