devise_invitable 1.7.4 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of devise_invitable might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/{CHANGELOG → CHANGELOG.md} +54 -19
- data/README.rdoc +98 -111
- data/app/controllers/devise/invitations_controller.rb +41 -41
- data/app/controllers/devise_invitable/registrations_controller.rb +11 -11
- data/app/views/devise/invitations/edit.html.erb +14 -8
- data/app/views/devise/invitations/new.html.erb +11 -7
- data/app/views/devise/mailer/invitation_instructions.html.erb +2 -2
- data/app/views/devise/mailer/invitation_instructions.text.erb +2 -2
- data/config/locales/ar.yml +23 -0
- data/config/locales/da.yml +41 -0
- data/config/locales/de.yml +31 -0
- data/config/locales/en.yml +1 -1
- data/config/locales/es.yml +31 -0
- data/config/locales/et.yml +23 -0
- data/config/locales/fa.yml +31 -0
- data/config/locales/fr.yml +34 -0
- data/config/locales/it.yml +31 -0
- data/config/locales/ja.yml +32 -0
- data/config/locales/ko.yml +24 -0
- data/config/locales/nl.yml +32 -0
- data/config/locales/no.yml +17 -0
- data/config/locales/pl.yml +31 -0
- data/config/locales/pt-BR.yml +23 -0
- data/config/locales/pt.yml +23 -0
- data/config/locales/ru.yml +23 -0
- data/config/locales/tr.yml +24 -0
- data/config/locales/ua.yml +31 -0
- data/config/locales/vi.yml +25 -0
- data/config/locales/zh-HK.yml +31 -0
- data/config/locales/zh-TW.yml +31 -0
- data/lib/devise_invitable.rb +5 -4
- data/lib/devise_invitable/controllers/helpers.rb +3 -4
- data/lib/devise_invitable/inviter.rb +4 -3
- data/lib/devise_invitable/mailer.rb +1 -1
- data/lib/devise_invitable/mapping.rb +6 -5
- data/lib/devise_invitable/models.rb +48 -32
- data/lib/devise_invitable/parameter_sanitizer.rb +18 -18
- data/lib/devise_invitable/routes.rb +5 -5
- data/lib/devise_invitable/version.rb +1 -1
- data/lib/generators/active_record/devise_invitable_generator.rb +3 -3
- data/lib/generators/active_record/templates/migration.rb +0 -1
- data/lib/generators/devise_invitable/devise_invitable_generator.rb +4 -8
- data/lib/generators/devise_invitable/install_generator.rb +11 -14
- data/lib/generators/devise_invitable/templates/simple_form_for/invitations/edit.html.erb +10 -6
- data/lib/generators/devise_invitable/templates/simple_form_for/invitations/new.html.erb +10 -6
- data/lib/generators/devise_invitable/views_generator.rb +6 -6
- data/test/functional/registrations_controller_test.rb +24 -25
- data/test/generators/views_generator_test.rb +7 -6
- data/test/generators_test.rb +3 -2
- data/test/integration/invitation_remove_test.rb +8 -8
- data/test/integration/invitation_test.rb +46 -46
- data/test/integration_tests_helper.rb +8 -9
- data/test/model_tests_helper.rb +5 -5
- data/test/models/invitable_test.rb +123 -108
- data/test/models_test.rb +3 -3
- data/test/orm/active_record.rb +5 -1
- data/test/orm/mongoid.rb +2 -2
- data/test/rails_app/app/controllers/admins_controller.rb +4 -3
- data/test/rails_app/app/controllers/application_controller.rb +11 -10
- data/test/rails_app/app/controllers/free_invitations_controller.rb +12 -9
- data/test/rails_app/app/controllers/users_controller.rb +2 -2
- data/test/rails_app/app/models/admin.rb +7 -10
- data/test/rails_app/app/models/octopussy.rb +4 -4
- data/test/rails_app/app/models/user.rb +20 -20
- data/test/rails_app/app/views/admins/new.html.erb +9 -5
- data/test/rails_app/app/views/devise/sessions/new.html.erb +14 -6
- data/test/rails_app/app/views/free_invitations/new.html.erb +9 -5
- data/test/rails_app/app/views/layouts/application.html.erb +3 -4
- data/test/rails_app/app/views/users/invitations/new.html.erb +15 -9
- data/test/rails_app/config/application.rb +7 -6
- data/test/rails_app/config/boot.rb +2 -2
- data/test/rails_app/config/credentials.yml.enc +1 -0
- data/test/rails_app/config/initializers/devise.rb +4 -3
- data/test/rails_app/config/initializers/secret_token.rb +3 -1
- data/test/rails_app/config/initializers/session_store.rb +1 -1
- data/test/rails_app/config/initializers/wrap_parameters.rb +1 -1
- data/test/rails_app/config/master.key +1 -0
- data/test/rails_app/config/routes.rb +3 -3
- data/test/rails_app/db/migrate/20100401102949_create_tables.rb +0 -2
- data/test/routes_test.rb +4 -4
- data/test/test_helper.rb +6 -19
- metadata +48 -23
data/test/models_test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class Invitable < User
|
4
|
-
devise :invitable, :
|
4
|
+
devise :invitable, invite_for: 5.days, validate_on_invite: true
|
5
5
|
end
|
6
6
|
|
7
7
|
class ModelsTest < ActiveSupport::TestCase
|
@@ -47,9 +47,9 @@ class ModelsTest < ActiveSupport::TestCase
|
|
47
47
|
|
48
48
|
test 'set a custom value for invite_key' do
|
49
49
|
old_invite_key = User.invite_key
|
50
|
-
User.invite_key = {:
|
50
|
+
User.invite_key = { username: /\A.+\z/}
|
51
51
|
|
52
|
-
assert_equal({:
|
52
|
+
assert_equal({ username: /\A.+\z/ }, User.invite_key)
|
53
53
|
|
54
54
|
User.invite_key = old_invite_key
|
55
55
|
end
|
data/test/orm/active_record.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
ActiveRecord::Migration.verbose = false
|
2
2
|
ActiveRecord::Base.logger = Logger.new(nil)
|
3
3
|
|
4
|
-
ActiveRecord::
|
4
|
+
if defined? ActiveRecord::MigrationContext # rails >= 5.2
|
5
|
+
ActiveRecord::MigrationContext.new(File.expand_path('../../rails_app/db/migrate/', __FILE__)).migrate
|
6
|
+
else
|
7
|
+
ActiveRecord::Migrator.migrate(File.expand_path('../../rails_app/db/migrate/', __FILE__))
|
8
|
+
end
|
data/test/orm/mongoid.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
Mongoid.configure do |config|
|
2
2
|
if Mongoid::VERSION < '3.0.0'
|
3
|
-
config.master = Mongo::Connection.new('127.0.0.1', 27017).db(
|
3
|
+
config.master = Mongo::Connection.new('127.0.0.1', 27017).db('devise_invitable-test-suite')
|
4
4
|
else
|
5
|
-
config.connect_to(
|
5
|
+
config.connect_to('devise_invitable-test-suite')
|
6
6
|
config.use_utc = true
|
7
7
|
config.include_root_in_json = true
|
8
8
|
end
|
@@ -1,17 +1,18 @@
|
|
1
1
|
class ApplicationController < ActionController::Base
|
2
2
|
protect_from_forgery
|
3
|
-
before_action :configure_permitted_parameters, :
|
3
|
+
before_action :configure_permitted_parameters, if: :devise_controller?
|
4
4
|
|
5
5
|
protected
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
|
7
|
+
def after_sign_in_path_for(resource)
|
8
|
+
if resource.is_a? Admin
|
9
|
+
edit_admin_registration_path(resource)
|
10
|
+
else
|
11
|
+
super
|
12
|
+
end
|
11
13
|
end
|
12
|
-
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
def configure_permitted_parameters
|
16
|
+
devise_parameter_sanitizer.permit(:sign_up, keys: [:email, :password, :bio])
|
17
|
+
end
|
17
18
|
end
|
@@ -1,12 +1,15 @@
|
|
1
1
|
class FreeInvitationsController < Devise::InvitationsController
|
2
2
|
protected
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
3
|
+
|
4
|
+
def authenticate_inviter!
|
5
|
+
# everyone can invite
|
6
|
+
end
|
7
|
+
|
8
|
+
def current_inviter
|
9
|
+
current_admin || current_user
|
10
|
+
end
|
11
|
+
|
12
|
+
def after_invite_path_for(resource)
|
13
|
+
resource ? super : root_path
|
14
|
+
end
|
12
15
|
end
|
@@ -2,11 +2,11 @@ class UsersController < ApplicationController
|
|
2
2
|
before_action :authenticate_user!
|
3
3
|
|
4
4
|
def index
|
5
|
-
user_session[:cart] =
|
5
|
+
user_session[:cart] = 'Cart'
|
6
6
|
end
|
7
7
|
|
8
8
|
def expire
|
9
9
|
user_session['last_request_at'] = 31.minutes.ago.utc
|
10
|
-
render :
|
10
|
+
render text: 'User will be expired on next request'
|
11
11
|
end
|
12
12
|
end
|
@@ -3,21 +3,18 @@ class Admin < PARENT_MODEL_CLASS
|
|
3
3
|
include Mongoid::Document
|
4
4
|
include Mongoid::Attributes::Dynamic if defined?(Mongoid::Attributes::Dynamic)
|
5
5
|
## Database authenticatable
|
6
|
-
field :email, :
|
7
|
-
field :encrypted_password, :
|
6
|
+
field :email, type: String, default: ""
|
7
|
+
field :encrypted_password, type: String, default: ""
|
8
8
|
validates_presence_of :email
|
9
|
-
validates_presence_of :encrypted_password, :
|
9
|
+
validates_presence_of :encrypted_password, if: :password_required?
|
10
10
|
|
11
11
|
## Confirmable
|
12
|
-
field :confirmation_token, :
|
13
|
-
field :confirmed_at, :
|
14
|
-
field :confirmation_sent_at, :
|
15
|
-
field :unconfirmed_email, :
|
16
|
-
|
12
|
+
field :confirmation_token, type: String
|
13
|
+
field :confirmed_at, type: Time
|
14
|
+
field :confirmation_sent_at, type: Time
|
15
|
+
field :unconfirmed_email, type: String # Only if using reconfirmable
|
17
16
|
end
|
18
17
|
|
19
|
-
|
20
|
-
|
21
18
|
devise :database_authenticatable, :validatable, :registerable
|
22
19
|
include DeviseInvitable::Inviter
|
23
20
|
end
|
@@ -5,11 +5,11 @@ class Octopussy < PARENT_MODEL_CLASS
|
|
5
5
|
include Mongoid::Attributes::Dynamic if defined?(Mongoid::Attributes::Dynamic)
|
6
6
|
|
7
7
|
## Database authenticatable
|
8
|
-
field :email, :
|
9
|
-
field :encrypted_password, :
|
8
|
+
field :email, type: String, default: ""
|
9
|
+
field :encrypted_password, type: String, default: ""
|
10
10
|
validates_presence_of :email
|
11
|
-
validates_presence_of :encrypted_password, :
|
12
|
-
|
11
|
+
validates_presence_of :encrypted_password, if: :password_required?
|
13
12
|
end
|
13
|
+
|
14
14
|
devise :database_authenticatable, :validatable, :confirmable
|
15
15
|
end
|
@@ -4,45 +4,45 @@ class User < PARENT_MODEL_CLASS
|
|
4
4
|
include Mongoid::Attributes::Dynamic if defined?(Mongoid::Attributes::Dynamic)
|
5
5
|
|
6
6
|
## Database authenticatable
|
7
|
-
field :email, :
|
8
|
-
field :encrypted_password, :
|
7
|
+
field :email, type: String, default: ""
|
8
|
+
field :encrypted_password, type: String, default: ""
|
9
9
|
|
10
10
|
## Recoverable
|
11
|
-
field :reset_password_token, :
|
12
|
-
field :reset_password_sent_at, :
|
11
|
+
field :reset_password_token, type: String
|
12
|
+
field :reset_password_sent_at, type: Time
|
13
13
|
|
14
14
|
## Confirmable
|
15
|
-
field :confirmation_token, :
|
16
|
-
field :confirmed_at, :
|
17
|
-
field :confirmation_sent_at, :
|
18
|
-
field :unconfirmed_email, :
|
15
|
+
field :confirmation_token, type: String
|
16
|
+
field :confirmed_at, type: Time
|
17
|
+
field :confirmation_sent_at, type: Time
|
18
|
+
field :unconfirmed_email, type: String # Only if using reconfirmable
|
19
19
|
|
20
20
|
## Invitable
|
21
|
-
field :invitation_token, :
|
22
|
-
field :invitation_created_at, :
|
23
|
-
field :invitation_sent_at, :
|
24
|
-
field :invitation_accepted_at, :
|
25
|
-
field :invitation_limit, :
|
26
|
-
field :invited_by_id, :
|
27
|
-
field :invited_by_type, :
|
21
|
+
field :invitation_token, type: String
|
22
|
+
field :invitation_created_at, type: Time
|
23
|
+
field :invitation_sent_at, type: Time
|
24
|
+
field :invitation_accepted_at, type: Time
|
25
|
+
field :invitation_limit, type: Integer
|
26
|
+
field :invited_by_id, type: Integer
|
27
|
+
field :invited_by_type, type: String
|
28
28
|
|
29
29
|
field :username
|
30
30
|
field :profile_id
|
31
31
|
field :active
|
32
32
|
|
33
33
|
validates_presence_of :email
|
34
|
-
validates_presence_of :encrypted_password, :
|
34
|
+
validates_presence_of :encrypted_password, if: :password_required?
|
35
35
|
end
|
36
36
|
|
37
37
|
devise :database_authenticatable, :registerable, :validatable, :confirmable, :invitable, :recoverable
|
38
38
|
|
39
39
|
attr_accessor :after_invitation_created_callback_works, :after_invitation_accepted_callback_works, :bio, :token
|
40
|
-
validates :username, :
|
40
|
+
validates :username, length: { maximum: 20 }
|
41
41
|
|
42
42
|
attr_accessor :testing_accepted_or_not_invited
|
43
43
|
|
44
|
-
validates :username, :
|
45
|
-
validates :bio, :
|
44
|
+
validates :username, presence: true, if: :testing_accepted_or_not_invited_validator?
|
45
|
+
validates :bio, presence: true, if: :invitation_accepted?
|
46
46
|
|
47
47
|
def testing_accepted_or_not_invited_validator?
|
48
48
|
testing_accepted_or_not_invited && accepted_or_not_invited?
|
@@ -56,7 +56,7 @@ class User < PARENT_MODEL_CLASS
|
|
56
56
|
object.after_invitation_accepted_callback_works = true
|
57
57
|
end
|
58
58
|
|
59
|
-
def send_devise_notification(method, raw=nil, *args)
|
59
|
+
def send_devise_notification(method, raw = nil, *args)
|
60
60
|
Thread.current[:token] = raw
|
61
61
|
super
|
62
62
|
end
|
@@ -1,12 +1,16 @@
|
|
1
1
|
<h2>Send invitation</h2>
|
2
2
|
|
3
|
-
<%= form_for
|
4
|
-
<%=
|
3
|
+
<%= form_for(resource, as: resource_name, url: admin_path) do |f| %>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
5
|
|
6
|
-
<
|
7
|
-
|
6
|
+
<div class="field">
|
7
|
+
<%= f.label :email %><br />
|
8
|
+
<%= f.text_field :email %>
|
9
|
+
</div>
|
8
10
|
|
9
|
-
<
|
11
|
+
<div class="actions">
|
12
|
+
<%= f.submit "Send an invitation" %>
|
13
|
+
</div>
|
10
14
|
<% end %>
|
11
15
|
|
12
16
|
<%= link_to "Home", after_sign_in_path_for(resource_name) %><br />
|
@@ -1,17 +1,25 @@
|
|
1
1
|
<h2>Log in</h2>
|
2
2
|
|
3
3
|
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
4
|
-
<div
|
5
|
-
|
4
|
+
<div class="field">
|
5
|
+
<%= f.label :email %><br />
|
6
|
+
<%= f.email_field :email, autofocus: true %>
|
7
|
+
</div>
|
6
8
|
|
7
|
-
<div
|
8
|
-
<%= f.
|
9
|
+
<div class="field">
|
10
|
+
<%= f.label :password %><br />
|
11
|
+
<%= f.password_field :password, autocomplete: "off" %>
|
12
|
+
</div>
|
9
13
|
|
10
14
|
<% if devise_mapping.rememberable? -%>
|
11
|
-
<div
|
15
|
+
<div class="field">
|
16
|
+
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
|
17
|
+
</div>
|
12
18
|
<% end -%>
|
13
19
|
|
14
|
-
<div
|
20
|
+
<div class="actions">
|
21
|
+
<%= f.submit "Log in" %>
|
22
|
+
</div>
|
15
23
|
<% end %>
|
16
24
|
|
17
25
|
<%= render "devise/shared/links" %>
|
@@ -1,12 +1,16 @@
|
|
1
1
|
<h2>Send invitation</h2>
|
2
2
|
|
3
|
-
<%= form_for
|
4
|
-
<%=
|
3
|
+
<%= form_for(resource, as: resource_name, url: free_invitation_path) do |f| %>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
5
|
|
6
|
-
<
|
7
|
-
|
6
|
+
<div class="field">
|
7
|
+
<%= f.label :email %><br />
|
8
|
+
<%= f.text_field :email %>
|
9
|
+
</div>
|
8
10
|
|
9
|
-
<
|
11
|
+
<div class="actions">
|
12
|
+
<%= f.submit "Send an invitation" %>
|
13
|
+
</div>
|
10
14
|
<% end %>
|
11
15
|
|
12
16
|
<%= link_to "Home", after_sign_in_path_for(resource_name) %><br />
|
@@ -7,10 +7,9 @@
|
|
7
7
|
<%= csrf_meta_tag %>
|
8
8
|
</head>
|
9
9
|
<body>
|
10
|
+
<%= content_tag :p, flash[:notice], id: 'notice' unless flash[:notice].blank? %>
|
11
|
+
<%= content_tag :p, flash[:alert], id: 'alert' unless flash[:alert].blank? %>
|
10
12
|
|
11
|
-
<%=
|
12
|
-
<%= content_tag :p, flash[:alert], :id => 'alert' unless flash[:alert].blank? %>
|
13
|
-
<%= yield %>
|
14
|
-
|
13
|
+
<%= yield %>
|
15
14
|
</body>
|
16
15
|
</html>
|
@@ -1,15 +1,21 @@
|
|
1
1
|
<h2>Send an invitation</h2>
|
2
2
|
|
3
|
-
<%= form_for
|
4
|
-
<%=
|
3
|
+
<%= form_for(resource, as: resource_name, url: invitation_path(resource_name), html: { method: :post }) do |f| %>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
5
|
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
<div class="field">
|
7
|
+
<%= f.label :username %>
|
8
|
+
<%= f.text_field :username %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="field">
|
12
|
+
<%= f.label :email %>
|
13
|
+
<%= f.text_field :email %>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<div class="actions">
|
17
|
+
<%= f.submit "Send an invitation" %>
|
18
|
+
</div>
|
13
19
|
<% end %>
|
14
20
|
|
15
21
|
<%= link_to "Home", after_sign_in_path_for(resource_name) %><br />
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require File.expand_path('../boot', __FILE__)
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
3
|
+
require 'action_controller/railtie'
|
4
|
+
require 'action_mailer/railtie'
|
5
|
+
require 'rails/test_unit/railtie'
|
6
6
|
|
7
7
|
Bundler.require(:default, DEVISE_ORM) if defined?(Bundler)
|
8
8
|
|
@@ -14,15 +14,16 @@ end
|
|
14
14
|
PARENT_MODEL_CLASS = DEVISE_ORM == :active_record ? ActiveRecord::Base : Object
|
15
15
|
Mongoid.load!(File.expand_path('../../mongoid.yml', __FILE__)) if DEVISE_ORM == :mongoid && Mongoid::VERSION < '3.0.0'
|
16
16
|
|
17
|
-
require
|
18
|
-
require
|
17
|
+
require 'devise'
|
18
|
+
require 'devise_invitable'
|
19
19
|
|
20
20
|
module RailsApp
|
21
21
|
class Application < Rails::Application
|
22
22
|
config.filter_parameters << :password
|
23
|
-
config.action_mailer.default_url_options = { :
|
23
|
+
config.action_mailer.default_url_options = { host: 'localhost:3000' }
|
24
24
|
if DEVISE_ORM == :active_record && Rails.version.start_with?('5')
|
25
25
|
config.active_record.maintain_test_schema = false
|
26
|
+
config.active_record.sqlite3.represent_boolean_as_integer = true if config.active_record.sqlite3
|
26
27
|
end
|
27
28
|
end
|
28
29
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
unless defined?(DEVISE_ORM)
|
2
|
-
DEVISE_ORM = (ENV[
|
2
|
+
DEVISE_ORM = (ENV['DEVISE_ORM'] || :active_record).to_sym
|
3
3
|
end
|
4
4
|
|
5
5
|
begin
|
6
|
-
require File.expand_path(
|
6
|
+
require File.expand_path('../../../../.bundle/environment', __FILE__)
|
7
7
|
rescue LoadError
|
8
8
|
require 'rubygems'
|
9
9
|
require 'bundler'
|
@@ -0,0 +1 @@
|
|
1
|
+
d19hQaf4kv/ajU/ABKNej/dqmAPNDfiZSBnGbsfBAs3oLxNVvuJm8TJ1bUMaZ2s2hcDSZRQKHtJqcDfBMrN0egkVPYaoGvYOZ7XzU2v9O1xhEwI9wFO+0yWDDTDxC8UJr60s+Gh++jQMCxTZ+Yhl5Od8d2rqoMcuhZrGhKOuvPBARyyDSN2/Q0rvIYO+OGFFkwTK+HD2ccRzYWBNH8DBMSeh8ja83BykLE0fNL9tPmYKK1gnEsME7AN8UN/AmFqFPLOX9otfQ0imwLhnsWMYPxqfJoqvgEpuAywPW3n3nIpzX1/dwpDrHnm5tbsIwgctlq4Q2DFu6dc7H3Pzjx6INWCB5pr97zH84+gHjYuoLafUxGEN8zbxFyrPe0Pm8jPi5qfJP3HlaweFR/XhNI1s+pl2WZQqAEkjMp0h--z4CX57AIHm+gPVBc--UBpBryKnypoqwmbLDIqa8Q==
|
@@ -91,8 +91,8 @@ Devise.setup do |config|
|
|
91
91
|
# config.pepper = "e31589192aeea8807cb7d8686b0f8484d6cbfaaa65443d45144519ed1d4ffbc6ccb73b21a69ece276d94f2cac95d83990d824f36f301d6f585ededd1bf90d67d"
|
92
92
|
|
93
93
|
# ==> Configuration for :invitable
|
94
|
-
# The period the generated invitation token is valid
|
95
|
-
# this period, the invited resource won't be able to accept the invitation.
|
94
|
+
# The period the generated invitation token is valid.
|
95
|
+
# After this period, the invited resource won't be able to accept the invitation.
|
96
96
|
# When invite_for is 0 (the default), the invitation won't expire.
|
97
97
|
# config.invite_for = 2.weeks
|
98
98
|
|
@@ -111,7 +111,8 @@ Devise.setup do |config|
|
|
111
111
|
# config.invite_key = {:email => /\\A[^@]+@[^@]+\\z/}
|
112
112
|
# config.invite_key = {:email => /\\A[^@]+@[^@]+\\z/, :username => nil}
|
113
113
|
|
114
|
-
#
|
114
|
+
# Ensure that invited record is valid.
|
115
|
+
# The invitation won't be sent if this check fails.
|
115
116
|
# Default: false
|
116
117
|
# config.validate_on_invite = true
|
117
118
|
|
@@ -4,4 +4,6 @@
|
|
4
4
|
# If you change this key, all old signed cookies will become invalid!
|
5
5
|
# Make sure the secret is at least 30 characters and all random,
|
6
6
|
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
|
7
|
+
if Rails.version < '5.2.0'
|
8
|
+
RailsApp::Application.config.secret_token = 'e997edf9d7eba5cf89a76a046fa53f5d66261d22cfcf29e3f538c75ad2d175b106bd5d099f44f6ce34ad3b3162d71cfaa37d2d4f4b38645288331427b4c2a607'
|
9
|
+
end
|