mcms_authentication 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +17 -0
- data/Rakefile +40 -0
- data/app/assets/images/background/page_bg.png +0 -0
- data/app/assets/images/background/text_field_background.png +0 -0
- data/app/assets/images/icons/accept.png +0 -0
- data/app/assets/images/icons/add.png +0 -0
- data/app/assets/images/icons/application_edit.png +0 -0
- data/app/assets/images/icons/cancel.png +0 -0
- data/app/assets/images/icons/delete.png +0 -0
- data/app/assets/images/icons/email_go.png +0 -0
- data/app/assets/images/rails.png +0 -0
- data/app/assets/javascripts/application.js +42 -0
- data/app/assets/javascripts/authentication_global.js +17 -0
- data/app/assets/stylesheets/application.css +33 -0
- data/app/assets/stylesheets/authentication_global.css +424 -0
- data/app/controllers/application_controller.rb +36 -0
- data/app/controllers/home_controller.rb +44 -0
- data/app/controllers/roles_controller.rb +375 -0
- data/app/controllers/users_controller.rb +202 -0
- data/app/models/ability.rb +82 -0
- data/app/models/existing_model.rb +24 -0
- data/app/models/plugin.rb +30 -0
- data/app/models/role.rb +70 -0
- data/app/models/roles_user.rb +33 -0
- data/app/models/user.rb +90 -0
- data/app/views/home/index.html.erb +18 -0
- data/app/views/layouts/users/_javascript.html.erb +3 -0
- data/app/views/layouts/users/_stylesheet.html.erb +3 -0
- data/app/views/layouts/users/devise.html.erb +40 -0
- data/app/views/layouts/users/home.html.erb +99 -0
- data/app/views/roles/_form.html.erb +240 -0
- data/app/views/roles/_form.js.erb +113 -0
- data/app/views/roles/edit.html.erb +26 -0
- data/app/views/roles/index.html.erb +73 -0
- data/app/views/roles/new.html.erb +25 -0
- data/app/views/users/_role.js.erb +47 -0
- data/app/views/users/confirmations/new.html.erb +29 -0
- data/app/views/users/edit.html.erb +131 -0
- data/app/views/users/index.html.erb +81 -0
- data/app/views/users/mailer/confirmation_instructions.html.erb +22 -0
- data/app/views/users/mailer/reset_password_instructions.html.erb +26 -0
- data/app/views/users/mailer/unlock_instructions.html.erb +24 -0
- data/app/views/users/new.html.erb +113 -0
- data/app/views/users/passwords/edit.html.erb +38 -0
- data/app/views/users/passwords/new.html.erb +32 -0
- data/app/views/users/sessions/new.html.erb +84 -0
- data/app/views/users/shared/_links.erb +39 -0
- data/app/views/users/unlocks/new.html.erb +25 -0
- data/config/initializers/constants.rb +30 -0
- data/config/initializers/devise.rb +217 -0
- data/config/locales/devise.en.yml +57 -0
- data/config/locales/en.yml +10 -0
- data/config/routes.rb +24 -0
- data/db/migrate/20120605112804_devise_create_users.rb +68 -0
- data/db/migrate/20120608104637_create_roles.rb +30 -0
- data/db/migrate/20120608140424_create_roles_users.rb +25 -0
- data/db/migrate/20120612050932_create_plugins.rb +14 -0
- data/db/migrate/20120625114340_create_existing_models.rb +9 -0
- data/db/migrate/20120711064709_add_username_to_users.rb +9 -0
- data/db/seeds.rb +29 -0
- data/lib/generators/mcms_authentication/USAGE +8 -0
- data/lib/generators/mcms_authentication/mcms_authentication_generator.rb +110 -0
- data/lib/generators/mcms_authentication/templates/asset_manager.rb +117 -0
- data/lib/generators/mcms_authentication/templates/models.rb +189 -0
- data/lib/mcms_authentication.rb +4 -0
- data/lib/mcms_authentication/engine.rb +20 -0
- data/lib/mcms_authentication/seeds.rb +14 -0
- data/lib/mcms_authentication/version.rb +3 -0
- data/lib/tasks/mcms_authentication_tasks.rake +4 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/fixtures/existing_models.yml +11 -0
- data/test/functional/home_controller_test.rb +7 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/mcms_authentication_test.rb +7 -0
- data/test/test_helper.rb +15 -0
- data/test/unit/existing_model_test.rb +7 -0
- data/test/unit/helpers/home_helper_test.rb +4 -0
- metadata +234 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
<!--
|
2
|
+
|
3
|
+
@File Name :unlock_instructions.html.erb
|
4
|
+
|
5
|
+
@Company Name :Mindfire Solutions Pvt. Ltd.
|
6
|
+
|
7
|
+
@Creator Name :Indranil Mukherjee
|
8
|
+
|
9
|
+
@Date Created :2012-06-04
|
10
|
+
|
11
|
+
@Date Modified :2012-06-14
|
12
|
+
|
13
|
+
@Last Modification Details :Making it as mcms project standard
|
14
|
+
|
15
|
+
@Purpose :Unlock instruction page
|
16
|
+
|
17
|
+
-->
|
18
|
+
<p>Hello <%= @resource.email %>!</p>
|
19
|
+
|
20
|
+
<p>Your account has been locked due to an excessive amount of unsuccessful sign in attempts.</p>
|
21
|
+
|
22
|
+
<p>Click the link below to unlock your account:</p>
|
23
|
+
|
24
|
+
<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p>
|
@@ -0,0 +1,113 @@
|
|
1
|
+
<!--
|
2
|
+
|
3
|
+
@File Name :new.html.erb
|
4
|
+
|
5
|
+
@Company Name :Mindfire Solutions Pvt. Ltd.
|
6
|
+
|
7
|
+
@Creator Name :Indranil Mukherjee
|
8
|
+
|
9
|
+
@Date Created :2012-06-04
|
10
|
+
|
11
|
+
@Date Modified :2012-06-14
|
12
|
+
|
13
|
+
@Last Modification Details :Making it as mcms project standard
|
14
|
+
|
15
|
+
@Purpose :A new user page
|
16
|
+
|
17
|
+
-->
|
18
|
+
|
19
|
+
<!-- This line of code is responsible for javascript to be loaded for this particular page -->
|
20
|
+
|
21
|
+
<% content_for :javascript, render(:partial => "role.js",:locals => {:all_roles => @all_roles}) %>
|
22
|
+
|
23
|
+
<div id="main-content" class="new-user-form" style="margin-top: 0px;padding-top: 21px; ">
|
24
|
+
|
25
|
+
<!--
|
26
|
+
|
27
|
+
The following form is responsible
|
28
|
+
for creating a new user with email and password.
|
29
|
+
|
30
|
+
-->
|
31
|
+
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
|
32
|
+
|
33
|
+
<%= devise_error_messages! %>
|
34
|
+
|
35
|
+
<div class="field session-username clearfix">
|
36
|
+
|
37
|
+
<%= f.label :email %><br />
|
38
|
+
|
39
|
+
<%= f.email_field :email %></div>
|
40
|
+
|
41
|
+
<div class="field session-username clearfix">
|
42
|
+
|
43
|
+
<%= f.label :first_name %><br />
|
44
|
+
|
45
|
+
<%= f.text_field :first_name %></div>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div class="field session-username clearfix">
|
50
|
+
|
51
|
+
<%= f.label :last_name %><br />
|
52
|
+
|
53
|
+
<%= f.text_field :last_name %></div>
|
54
|
+
|
55
|
+
|
56
|
+
<div class="field session-username clearfix">
|
57
|
+
|
58
|
+
<%= f.label :password %><br />
|
59
|
+
|
60
|
+
<%= f.password_field :password %></div>
|
61
|
+
|
62
|
+
<div class="field session-username clearfix"><%= f.label :password_confirmation %><br />
|
63
|
+
|
64
|
+
<%= f.password_field :password_confirmation %></div>
|
65
|
+
|
66
|
+
|
67
|
+
<div class="field plugin-access">
|
68
|
+
|
69
|
+
<span class="label-with-help">
|
70
|
+
|
71
|
+
<label for="user-plugin-access" class="title-label">Define Roles</label>
|
72
|
+
|
73
|
+
</span>
|
74
|
+
|
75
|
+
<ul class="checkboxes" id="plugins">
|
76
|
+
|
77
|
+
<% @all_roles.each do |role| %>
|
78
|
+
|
79
|
+
<li>
|
80
|
+
|
81
|
+
<%= check_box_tag "#{role.id}" %>
|
82
|
+
|
83
|
+
<%= hidden_field_tag "#{role.id}_value" %>
|
84
|
+
|
85
|
+
<label for="plugins-refinery-files" class="stripped"><%= role.title %></label>
|
86
|
+
|
87
|
+
</li>
|
88
|
+
|
89
|
+
<% end %>
|
90
|
+
|
91
|
+
</ul>
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
<div class="form-actions" style="border-radius: 5px 5px 5px 5px;">
|
96
|
+
|
97
|
+
<div class="form-actions-left">
|
98
|
+
|
99
|
+
<%= f.submit "Save",:class => "button" %>
|
100
|
+
|
101
|
+
<%= link_to "Cancel",mcms_users_path,:id => "cancel",:class => "close-dialog button" %>
|
102
|
+
|
103
|
+
</div>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
|
108
|
+
<% end %>
|
109
|
+
|
110
|
+
|
111
|
+
</div>
|
112
|
+
|
113
|
+
<!-- End of New User creation -->
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<!--
|
2
|
+
|
3
|
+
@File Name :edit.html.erb
|
4
|
+
|
5
|
+
@Company Name :Mindfire Solutions Pvt. Ltd.
|
6
|
+
|
7
|
+
@Creator Name :Indranil Mukherjee
|
8
|
+
|
9
|
+
@Date Created :2012-06-04
|
10
|
+
|
11
|
+
@Date Modified :2012-06-14
|
12
|
+
|
13
|
+
@Last Modification Details :Making it as mcms project standard
|
14
|
+
|
15
|
+
@Purpose :Passwords edit page
|
16
|
+
|
17
|
+
-->
|
18
|
+
<h2>Change your password</h2>
|
19
|
+
|
20
|
+
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
|
21
|
+
|
22
|
+
<%= devise_error_messages! %>
|
23
|
+
|
24
|
+
<%= f.hidden_field :reset_password_token %>
|
25
|
+
|
26
|
+
<div><%= f.label :password, "New password" %><br />
|
27
|
+
|
28
|
+
<%= f.password_field :password %></div>
|
29
|
+
|
30
|
+
<div><%= f.label :password_confirmation, "Confirm new password" %><br />
|
31
|
+
|
32
|
+
<%= f.password_field :password_confirmation %></div>
|
33
|
+
|
34
|
+
<div><%= f.submit "Change my password" %></div>
|
35
|
+
|
36
|
+
<% end %>
|
37
|
+
|
38
|
+
<%= render :partial => "devise/shared/links" %>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<!--
|
2
|
+
|
3
|
+
@File Name :new.html.erb
|
4
|
+
|
5
|
+
@Company Name :Mindfire Solutions Pvt. Ltd.
|
6
|
+
|
7
|
+
@Creator Name :Indranil Mukherjee
|
8
|
+
|
9
|
+
@Date Created :2012-06-04
|
10
|
+
|
11
|
+
@Date Modified :2012-06-14
|
12
|
+
|
13
|
+
@Last Modification Details :Making it as mcms project standard
|
14
|
+
|
15
|
+
@Purpose :new password page
|
16
|
+
|
17
|
+
-->
|
18
|
+
<div id="main-content" class="new-user-form" style="margin-top: 0px;padding-top: 21px; ">
|
19
|
+
|
20
|
+
<h2>Forgot your password?</h2>
|
21
|
+
|
22
|
+
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
|
23
|
+
<%= devise_error_messages! %>
|
24
|
+
|
25
|
+
<div><%= f.label :email %><br />
|
26
|
+
<%= f.email_field :email %></div>
|
27
|
+
|
28
|
+
<div><%= f.submit "Send me reset password instructions" %></div>
|
29
|
+
<% end %>
|
30
|
+
|
31
|
+
|
32
|
+
</div>
|
@@ -0,0 +1,84 @@
|
|
1
|
+
<!--
|
2
|
+
**************************************************************************************************************
|
3
|
+
|
4
|
+
FileName: new.html.erb
|
5
|
+
|
6
|
+
Company Name and Copyright information: Mindfire Solutions Pvt. Ltd.
|
7
|
+
|
8
|
+
Creator name and date: Indranil Mukherjee 04/06/2012
|
9
|
+
|
10
|
+
Description of the file contents: Sign in page
|
11
|
+
|
12
|
+
|
13
|
+
**************************************************************************************************************
|
14
|
+
-->
|
15
|
+
|
16
|
+
<div class="new-session" >
|
17
|
+
|
18
|
+
<h2><%= t(:sign_in,:default => "Please Sign in") %></h2>
|
19
|
+
|
20
|
+
<div id="logincontainer" style="margin-top: 10px;">
|
21
|
+
|
22
|
+
<!--<div style="visibility: visible; opacity: 1;margin-top: 20px;margin-left: 5px;margin-right: 5px;margin-bottom: 20px; " class="mcms_flash mcms_flash_notice" id="mcms_flash">
|
23
|
+
|
24
|
+
<%#= t(:default_uname) %> '<strong></strong>'
|
25
|
+
|
26
|
+
<a id="mcms_flash_close" href="#">Close</a>
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
</div>-->
|
31
|
+
|
32
|
+
<!--
|
33
|
+
|
34
|
+
The following form is responsible for sign in
|
35
|
+
|
36
|
+
-->
|
37
|
+
|
38
|
+
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
39
|
+
|
40
|
+
<div class="field session-username clearfix"><%= f.label :email %><br />
|
41
|
+
|
42
|
+
<%= f.email_field :email %>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div class="field session-username clearfix"><%= f.label :password %><br />
|
47
|
+
|
48
|
+
<%= f.password_field :password %>
|
49
|
+
|
50
|
+
</div>
|
51
|
+
|
52
|
+
<% if devise_mapping.rememberable? -%>
|
53
|
+
|
54
|
+
<div class="remembers">
|
55
|
+
|
56
|
+
<div style="float: left"><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
|
57
|
+
|
58
|
+
<div style="float: right; font-weight: normal;"><%= link_to "Forgot your password?", new_password_path(resource_name) ,:style => "margin-right: 5px;" %></div>
|
59
|
+
|
60
|
+
<div style="clear: both"/>
|
61
|
+
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<% end -%>
|
65
|
+
|
66
|
+
<div class="form-actions">
|
67
|
+
|
68
|
+
<div class="form-actions-left"><%= f.submit "Sign in" ,:class => "button"%>
|
69
|
+
|
70
|
+
</div>
|
71
|
+
|
72
|
+
<div class="form-actions-right">
|
73
|
+
|
74
|
+
</div>
|
75
|
+
|
76
|
+
</div>
|
77
|
+
|
78
|
+
<% end %>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
</div>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<!--
|
2
|
+
**************************************************************************************************************
|
3
|
+
|
4
|
+
FileName: _links.html.erb
|
5
|
+
|
6
|
+
Company Name and Copyright information: Mindfire Solutions Pvt. Ltd.
|
7
|
+
|
8
|
+
Creator name and date: Indranil Mukherjee 04/06/2012
|
9
|
+
|
10
|
+
Description of the file contents: Shared link created by devise
|
11
|
+
|
12
|
+
|
13
|
+
**************************************************************************************************************
|
14
|
+
-->
|
15
|
+
<%- if controller_name != 'sessions' %>
|
16
|
+
<%= link_to "Sign in", new_session_path(resource_name) %><br />
|
17
|
+
<% end -%>
|
18
|
+
|
19
|
+
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
20
|
+
<%#= link_to "Sign up", new_registration_path(resource_name) %><br />
|
21
|
+
<% end -%>
|
22
|
+
|
23
|
+
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
|
24
|
+
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
|
25
|
+
<% end -%>
|
26
|
+
|
27
|
+
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
28
|
+
<%#= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
|
29
|
+
<% end -%>
|
30
|
+
|
31
|
+
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
32
|
+
<%#= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
|
33
|
+
<% end -%>
|
34
|
+
|
35
|
+
<%- if devise_mapping.omniauthable? %>
|
36
|
+
<%- resource_class.omniauth_providers.each do |provider| %>
|
37
|
+
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
|
38
|
+
<% end -%>
|
39
|
+
<% end -%>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!--
|
2
|
+
**************************************************************************************************************
|
3
|
+
|
4
|
+
FileName: new.html.erb
|
5
|
+
|
6
|
+
Company Name and Copyright information: Mindfire Solutions Pvt. Ltd.
|
7
|
+
|
8
|
+
Creator name and date: Indranil Mukherjee 04/06/2012
|
9
|
+
|
10
|
+
Description of the file contents: Reset unlock instructions page
|
11
|
+
|
12
|
+
|
13
|
+
**************************************************************************************************************
|
14
|
+
-->
|
15
|
+
<h2>Resend unlock instructions</h2>
|
16
|
+
|
17
|
+
<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
|
18
|
+
<%= devise_error_messages! %>
|
19
|
+
|
20
|
+
<div><%= f.label :email %><br />
|
21
|
+
<%= f.email_field :email %></div>
|
22
|
+
|
23
|
+
<div><%= f.submit "Resend unlock instructions" %></div>
|
24
|
+
<% end %>
|
25
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
=begin
|
2
|
+
*************************************************************************************************************
|
3
|
+
FileName: constants.rb
|
4
|
+
|
5
|
+
Company Name and Copyright information: Mindfire Solutions Pvt. Ltd.
|
6
|
+
|
7
|
+
Creator name and date: Indranil Mukherjee 07/06/2012
|
8
|
+
|
9
|
+
Description of the file contents: This is containing the constants which are used globally
|
10
|
+
|
11
|
+
*************************************************************************************************************
|
12
|
+
=end
|
13
|
+
|
14
|
+
USER_CREATION_TIME_FORMAT = "%A, %d %B %Y" # user creation date format to be displayed
|
15
|
+
|
16
|
+
MODEL_DIR = 'app/models/*.rb' # model path
|
17
|
+
|
18
|
+
ALL = "_all"
|
19
|
+
|
20
|
+
READ = "_read"
|
21
|
+
|
22
|
+
CREATE = "_create"
|
23
|
+
|
24
|
+
UPDATE = "_update"
|
25
|
+
|
26
|
+
DESTROY = "_destroy"
|
27
|
+
|
28
|
+
VALUE = "_value"
|
29
|
+
|
30
|
+
HOME_LAYOUT = "users/home"
|
@@ -0,0 +1,217 @@
|
|
1
|
+
# Use this hook to configure devise mailer, warden hooks and so forth.
|
2
|
+
# Many of these configuration options can be set straight in your model.
|
3
|
+
|
4
|
+
Devise.setup do |config|
|
5
|
+
# ==> Mailer Configuration
|
6
|
+
# Configure the e-mail address which will be shown in Devise::Mailer,
|
7
|
+
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
|
8
|
+
config.mailer_sender = "testmyprojects101@gmail.com"
|
9
|
+
|
10
|
+
# Configure the class responsible to send e-mails.
|
11
|
+
# config.mailer = "Devise::Mailer"
|
12
|
+
|
13
|
+
# ==> ORM configuration
|
14
|
+
# Load and configure the ORM. Supports :active_record (default) and
|
15
|
+
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
16
|
+
# available as additional gems.
|
17
|
+
require 'devise/orm/active_record'
|
18
|
+
|
19
|
+
# ==> Configuration for any authentication mechanism
|
20
|
+
# Configure which keys are used when authenticating a user. The default is
|
21
|
+
# just :email. You can configure it to use [:username, :subdomain], so for
|
22
|
+
# authenticating a user, both parameters are required. Remember that those
|
23
|
+
# parameters are used only when authenticating and not when retrieving from
|
24
|
+
# session. If you need permissions, you should implement that in a before filter.
|
25
|
+
# You can also supply a hash where the value is a boolean determining whether
|
26
|
+
# or not authentication should be aborted when the value is not present.
|
27
|
+
# config.authentication_keys = [ :email ]
|
28
|
+
|
29
|
+
# Configure parameters from the request object used for authentication. Each entry
|
30
|
+
# given should be a request method and it will automatically be passed to the
|
31
|
+
# find_for_authentication method and considered in your model lookup. For instance,
|
32
|
+
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
33
|
+
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
34
|
+
# config.request_keys = []
|
35
|
+
|
36
|
+
# Configure which authentication keys should be case-insensitive.
|
37
|
+
# These keys will be downcased upon creating or modifying a user and when used
|
38
|
+
# to authenticate or find a user. Default is :email.
|
39
|
+
config.case_insensitive_keys = [ :email ]
|
40
|
+
|
41
|
+
# Configure which authentication keys should have whitespace stripped.
|
42
|
+
# These keys will have whitespace before and after removed upon creating or
|
43
|
+
# modifying a user and when used to authenticate or find a user. Default is :email.
|
44
|
+
config.strip_whitespace_keys = [ :email ]
|
45
|
+
|
46
|
+
# Tell if authentication through request.params is enabled. True by default.
|
47
|
+
# It can be set to an array that will enable params authentication only for the
|
48
|
+
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
49
|
+
# enable it only for database (email + password) authentication.
|
50
|
+
# config.params_authenticatable = true
|
51
|
+
|
52
|
+
# Tell if authentication through HTTP Basic Auth is enabled. False by default.
|
53
|
+
# It can be set to an array that will enable http authentication only for the
|
54
|
+
# given strategies, for example, `config.http_authenticatable = [:token]` will
|
55
|
+
# enable it only for token authentication.
|
56
|
+
# config.http_authenticatable = false
|
57
|
+
|
58
|
+
# If http headers should be returned for AJAX requests. True by default.
|
59
|
+
# config.http_authenticatable_on_xhr = true
|
60
|
+
|
61
|
+
# The realm used in Http Basic Authentication. "Application" by default.
|
62
|
+
# config.http_authentication_realm = "Application"
|
63
|
+
|
64
|
+
# It will change confirmation, password recovery and other workflows
|
65
|
+
# to behave the same regardless if the e-mail provided was right or wrong.
|
66
|
+
# Does not affect registerable.
|
67
|
+
# config.paranoid = true
|
68
|
+
|
69
|
+
# By default Devise will store the user in session. You can skip storage for
|
70
|
+
# :http_auth and :token_auth by adding those symbols to the array below.
|
71
|
+
# Notice that if you are skipping storage for all authentication paths, you
|
72
|
+
# may want to disable generating routes to Devise's sessions controller by
|
73
|
+
# passing :skip => :sessions to `devise_for` in your config/routes.rb
|
74
|
+
config.skip_session_storage = [:http_auth]
|
75
|
+
|
76
|
+
# ==> Configuration for :database_authenticatable
|
77
|
+
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
|
78
|
+
# using other encryptors, it sets how many times you want the password re-encrypted.
|
79
|
+
#
|
80
|
+
# Limiting the stretches to just one in testing will increase the performance of
|
81
|
+
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
82
|
+
# a value less than 10 in other environments.
|
83
|
+
config.stretches = Rails.env.test? ? 1 : 10
|
84
|
+
|
85
|
+
# Setup a pepper to generate the encrypted password.
|
86
|
+
# config.pepper = "0917b47550d7846adaffa8ec8e2957bcff2af2bc72a7ca5aad17cdcd9083f4a4112a234499f79a3a6517770c61ee323fd2ae579be86fa342987b2e873ff958f2"
|
87
|
+
|
88
|
+
# ==> Configuration for :confirmable
|
89
|
+
# A period that the user is allowed to access the website even without
|
90
|
+
# confirming his account. For instance, if set to 2.days, the user will be
|
91
|
+
# able to access the website for two days without confirming his account,
|
92
|
+
# access will be blocked just in the third day. Default is 0.days, meaning
|
93
|
+
# the user cannot access the website without confirming his account.
|
94
|
+
# config.allow_unconfirmed_access_for = 2.days
|
95
|
+
|
96
|
+
# If true, requires any email changes to be confirmed (exactly the same way as
|
97
|
+
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
98
|
+
# db field (see migrations). Until confirmed new email is stored in
|
99
|
+
# unconfirmed email column, and copied to email column on successful confirmation.
|
100
|
+
config.reconfirmable = true
|
101
|
+
|
102
|
+
# Defines which key will be used when confirming an account
|
103
|
+
# config.confirmation_keys = [ :email ]
|
104
|
+
|
105
|
+
# ==> Configuration for :rememberable
|
106
|
+
# The time the user will be remembered without asking for credentials again.
|
107
|
+
# config.remember_for = 2.weeks
|
108
|
+
|
109
|
+
# If true, extends the user's remember period when remembered via cookie.
|
110
|
+
# config.extend_remember_period = false
|
111
|
+
|
112
|
+
# Options to be passed to the created cookie. For instance, you can set
|
113
|
+
# :secure => true in order to force SSL only cookies.
|
114
|
+
# config.rememberable_options = {}
|
115
|
+
|
116
|
+
# ==> Configuration for :validatable
|
117
|
+
# Range for password length. Default is 6..128.
|
118
|
+
# config.password_length = 6..128
|
119
|
+
|
120
|
+
# Email regex used to validate email formats. It simply asserts that
|
121
|
+
# an one (and only one) @ exists in the given string. This is mainly
|
122
|
+
# to give user feedback and not to assert the e-mail validity.
|
123
|
+
# config.email_regexp = /\A[^@]+@[^@]+\z/
|
124
|
+
|
125
|
+
# ==> Configuration for :timeoutable
|
126
|
+
# The time you want to timeout the user session without activity. After this
|
127
|
+
# time the user will be asked for credentials again. Default is 30 minutes.
|
128
|
+
# config.timeout_in = 30.minutes
|
129
|
+
|
130
|
+
# ==> Configuration for :lockable
|
131
|
+
# Defines which strategy will be used to lock an account.
|
132
|
+
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
133
|
+
# :none = No lock strategy. You should handle locking by yourself.
|
134
|
+
# config.lock_strategy = :failed_attempts
|
135
|
+
|
136
|
+
# Defines which key will be used when locking and unlocking an account
|
137
|
+
# config.unlock_keys = [ :email ]
|
138
|
+
|
139
|
+
# Defines which strategy will be used to unlock an account.
|
140
|
+
# :email = Sends an unlock link to the user email
|
141
|
+
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
142
|
+
# :both = Enables both strategies
|
143
|
+
# :none = No unlock strategy. You should handle unlocking by yourself.
|
144
|
+
# config.unlock_strategy = :both
|
145
|
+
|
146
|
+
# Number of authentication tries before locking an account if lock_strategy
|
147
|
+
# is failed attempts.
|
148
|
+
# config.maximum_attempts = 20
|
149
|
+
|
150
|
+
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
151
|
+
# config.unlock_in = 1.hour
|
152
|
+
|
153
|
+
# ==> Configuration for :recoverable
|
154
|
+
#
|
155
|
+
# Defines which key will be used when recovering the password for an account
|
156
|
+
# config.reset_password_keys = [ :email ]
|
157
|
+
|
158
|
+
# Time interval you can reset your password with a reset password key.
|
159
|
+
# Don't put a too small interval or your users won't have the time to
|
160
|
+
# change their passwords.
|
161
|
+
config.reset_password_within = 6.hours
|
162
|
+
|
163
|
+
# ==> Configuration for :encryptable
|
164
|
+
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
|
165
|
+
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
|
166
|
+
# :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
|
167
|
+
# and :restful_authentication_sha1 (then you should set stretches to 10, and copy
|
168
|
+
# REST_AUTH_SITE_KEY to pepper)
|
169
|
+
# config.encryptor = :sha512
|
170
|
+
|
171
|
+
# ==> Configuration for :token_authenticatable
|
172
|
+
# Defines name of the authentication token params key
|
173
|
+
# config.token_authentication_key = :auth_token
|
174
|
+
|
175
|
+
# ==> Scopes configuration
|
176
|
+
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
177
|
+
# "users/sessions/new". It's turned off by default because it's slower if you
|
178
|
+
# are using only default views.
|
179
|
+
config.scoped_views = true
|
180
|
+
|
181
|
+
# Configure the default scope given to Warden. By default it's the first
|
182
|
+
# devise role declared in your routes (usually :user).
|
183
|
+
# config.default_scope = :user
|
184
|
+
|
185
|
+
# Configure sign_out behavior.
|
186
|
+
# Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
|
187
|
+
# The default is true, which means any logout action will sign out all active scopes.
|
188
|
+
# config.sign_out_all_scopes = true
|
189
|
+
|
190
|
+
# ==> Navigation configuration
|
191
|
+
# Lists the formats that should be treated as navigational. Formats like
|
192
|
+
# :html, should redirect to the sign in page when the user does not have
|
193
|
+
# access, but formats like :xml or :json, should return 401.
|
194
|
+
#
|
195
|
+
# If you have any extra navigational formats, like :iphone or :mobile, you
|
196
|
+
# should add them to the navigational formats lists.
|
197
|
+
#
|
198
|
+
# The "*/*" below is required to match Internet Explorer requests.
|
199
|
+
# config.navigational_formats = ["*/*", :html]
|
200
|
+
|
201
|
+
# The default HTTP method used to sign out a resource. Default is :delete.
|
202
|
+
config.sign_out_via = :delete
|
203
|
+
|
204
|
+
# ==> OmniAuth
|
205
|
+
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
206
|
+
# up on your models and hooks.
|
207
|
+
# config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
|
208
|
+
|
209
|
+
# ==> Warden configuration
|
210
|
+
# If you want to use other strategies, that are not supported by Devise, or
|
211
|
+
# change the failure app, you can configure them inside the config.warden block.
|
212
|
+
#
|
213
|
+
# config.warden do |manager|
|
214
|
+
# manager.intercept_401 = false
|
215
|
+
# manager.default_strategies(:scope => :user).unshift :some_external_strategy
|
216
|
+
# end
|
217
|
+
end
|