omniauth-campus 8.1 → 8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/omniauth-campus/version.rb +1 -1
- data/lib/omniauth/strategies/campus.rb +29 -17
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb0354acf5eecfcd3dabb3ae09105085d0c15dfe
|
4
|
+
data.tar.gz: 9e6e17f9ad79cb602eac5aa726b0d64d4ecec0ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2be70ab32188a2129d1746c549936fd5b4a1ae31f102137d25f8850a9ec13d82a718b60e3d575e691e88a8032f100c9df8b2cc060b99d3beb71b062f9d36143d
|
7
|
+
data.tar.gz: 2e7793472eab1bcb522e39b136ccf340133eefa410beeaef31a3721d9723e77b9a987248e7ab988e7e8045c9600136e1e91d7fb816c583c819e32f4381bc94b6
|
@@ -1,29 +1,41 @@
|
|
1
|
-
require 'omniauth-oauth'
|
2
|
-
require 'multi_json'
|
3
1
|
|
4
2
|
module OmniAuth
|
5
3
|
module Strategies
|
6
|
-
class
|
7
|
-
|
4
|
+
class Password
|
5
|
+
include OmniAuth::Strategy
|
8
6
|
|
9
|
-
option :
|
10
|
-
|
11
|
-
}
|
7
|
+
option :user_model, nil # default set to 'User' below
|
8
|
+
option :login_field, :email
|
12
9
|
|
13
|
-
|
14
|
-
|
10
|
+
def request_phase
|
11
|
+
redirect "/session/new"
|
15
12
|
end
|
16
13
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
:email => raw_info[0]['users_mail']
|
21
|
-
}
|
14
|
+
def callback_phase
|
15
|
+
return fail!(:invalid_credentials) unless user.try(:authenticate, password)
|
16
|
+
super
|
22
17
|
end
|
23
18
|
|
24
|
-
def
|
25
|
-
@
|
19
|
+
def user
|
20
|
+
@user ||= user_model.send("find_by_#{options[:login_field]}", login)
|
26
21
|
end
|
27
|
-
|
22
|
+
|
23
|
+
def user_model
|
24
|
+
options[:user_model] || ::User
|
25
|
+
end
|
26
|
+
|
27
|
+
def login
|
28
|
+
request[:sessions][options[:login_field].to_s]
|
29
|
+
end
|
30
|
+
|
31
|
+
def password
|
32
|
+
request[:sessions]['password']
|
33
|
+
end
|
34
|
+
|
35
|
+
uid do
|
36
|
+
user.password_digest
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
28
40
|
end
|
29
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-campus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '8.
|
4
|
+
version: '8.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- johnvehr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|