exvo-auth 0.3.2 → 0.3.3
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.
- data/VERSION +1 -1
- data/exvo-auth.gemspec +1 -1
- data/lib/exvo_auth/controllers/base.rb +0 -2
- data/lib/exvo_auth/controllers/merb.rb +18 -10
- data/lib/exvo_auth/controllers/rails.rb +10 -7
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.3
|
data/exvo-auth.gemspec
CHANGED
@@ -1,17 +1,25 @@
|
|
1
1
|
module ExvoAuth::Controllers::Merb
|
2
2
|
def self.included(base)
|
3
3
|
base.send :include, ExvoAuth::Controllers::Base
|
4
|
+
base.send :include, InstanceMethods
|
4
5
|
end
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
7
|
+
module InstanceMethods
|
8
|
+
def authenticate_user!
|
9
|
+
super
|
10
|
+
throw :halt unless signed_in?
|
11
|
+
end
|
12
|
+
|
13
|
+
def redirect_to(*args)
|
14
|
+
redirect(*args)
|
15
|
+
end
|
16
|
+
|
17
|
+
def find_user_by_id(id)
|
18
|
+
User[id]
|
19
|
+
end
|
20
|
+
|
21
|
+
def current_url
|
22
|
+
request.full_uri if request.method == :get
|
23
|
+
end
|
16
24
|
end
|
17
25
|
end
|
@@ -1,14 +1,17 @@
|
|
1
1
|
module ExvoAuth::Controllers::Rails
|
2
2
|
def self.included(base)
|
3
3
|
base.send :include, ExvoAuth::Controllers::Base
|
4
|
-
|
4
|
+
base_send :include, InstanceMethods
|
5
|
+
base.helper_method :current_user, :signed_in?, :sign_in_path, :sign_up_path
|
5
6
|
end
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
module InstanceMethods
|
9
|
+
def find_user_by_id(id)
|
10
|
+
User.find(id)
|
11
|
+
end
|
12
|
+
|
13
|
+
def current_url
|
14
|
+
request.url if request.get?
|
15
|
+
end
|
13
16
|
end
|
14
17
|
end
|