brightcontent-core 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca3785050aa8c2db2a8007bb9a8a648b0f6cb13b
4
- data.tar.gz: e8e2b8ffa1d5f558461b91b095b442bb6f9d860c
3
+ metadata.gz: 15ccf70f8a55ca561620e15e8eec3cd90b775e38
4
+ data.tar.gz: 3b42b987a2fb5062801df59e4331bfebccd8c672
5
5
  SHA512:
6
- metadata.gz: e29b0764abbb6d0032b59b0884a1555964db4fb686745febb4ffff0319c8b9afc1612f976dd939988f25f8ac2cbdb96b3ef7f74195135519cc3c2f9e4abd3614
7
- data.tar.gz: 4537fa305e9fde2652e29e51ea08e0a4e2e2816d6c74e17fb5d5e9f6984cc1920952cdd7231589ddc8080eb59f5eaa61719b9989716c3aa508949ecebe98b4e9
6
+ metadata.gz: 1119176ccda99c90fa492652167d41640c17437085b9a72323a0958e6c21b18451e5519f80e976d7e8df3505123b1efc6b32e33f6c8f7740115451379f886cdc
7
+ data.tar.gz: 33f7cfeb6846bac7342d20bf9aad1ee3314e42dad83cf03fbdc7ae1bd28d1fd4d4aef569b0c3cf74e381ca506a917e89eea79cbfbf551e3dab0101709a4f3ce6
@@ -9,8 +9,8 @@ module Brightcontent
9
9
  end
10
10
 
11
11
  def create
12
- user = Brightcontent.user_model.find_by_email(params[:email])
13
- if user && user.authenticate(params[:password])
12
+ user = Brightcontent.user_model.authenticate(params[:email], params[:password])
13
+ if user
14
14
  session[:brightcontent_user_id] = user.id
15
15
  redirect_to root_url
16
16
  else
@@ -3,5 +3,9 @@ module Brightcontent
3
3
  has_secure_password
4
4
  validates_uniqueness_of :email
5
5
  attr_accessible *column_names if defined? ProtectedAttributes
6
+
7
+ def self.authenticate(email, password)
8
+ find_by_email(email).try :authenticate, password
9
+ end
6
10
  end
7
11
  end
@@ -20,7 +20,7 @@ Brightcontent.setup do |config|
20
20
 
21
21
  # Brightcontent provides its own user model: AdminUser. This is used by
22
22
  # default. You can specify a custom user model as string or class.
23
- # It has to implement an authenticate method.
23
+ # It has to implement an `authenticate` class method.
24
24
  # config.user_model = "Brightcontent::AdminUser"
25
25
 
26
26
  # brightcontent-pages provides a Brightcontent::Page model which is used
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brightcontent-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Developers at Brightin