user_authentication 0.2.1 → 0.2.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c8b1691ba9a0656d78f9b4ead0f924766db2474
|
4
|
+
data.tar.gz: 3790adc45865fb6c5128a9ec09bee93fbcdda9ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de9db33d6dd091ccabc1fe46f05eadaabc636f1b2353ca88316a34c93d67a445c975b43ba4e5d2485daef5b04fadd2cf75f823694e2799597ac48ab8cbe273dd
|
7
|
+
data.tar.gz: e1f5c3564b7563be06c92ed62edda49c83eaa6f6bfb467510014462d877333ded92aa326cb1106f3d1ed4e473fc2afa12d3ab833bbca7c87e11c3ccf99a9c29d
|
@@ -7,13 +7,13 @@ class ApplicationController < ActionController::Base
|
|
7
7
|
def authorize(redirect=nil)
|
8
8
|
# Not using skip_before_filter, since main app could inadvertently override that
|
9
9
|
# by using a before_filter :authorize in its application_controller.
|
10
|
-
if params[:controller] ==
|
10
|
+
if params[:controller] == 'users' && ['do_login', 'login', 'logout', 'do_signup', 'signup'].include?(params[:action])
|
11
11
|
return true
|
12
12
|
end
|
13
13
|
|
14
14
|
if current_user.nil?
|
15
15
|
session[:redirect] = url_for params
|
16
|
-
redirect_to redirect || login_path, alert:
|
16
|
+
redirect_to redirect || login_path, alert: 'Please log in to access this page.'
|
17
17
|
else
|
18
18
|
return true
|
19
19
|
end
|
@@ -35,8 +35,8 @@ class ApplicationController < ActionController::Base
|
|
35
35
|
|
36
36
|
def redirect
|
37
37
|
session_redirect = session.delete(:redirect)
|
38
|
-
redirect_to params[:redirect] || session_redirect ||
|
38
|
+
redirect_to params[:redirect] || session_redirect || root_path
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
require File.join Rails.root,
|
42
|
+
require File.join Rails.root, 'app/controllers/application_controller'
|
@@ -19,7 +19,7 @@ class UsersController < ApplicationController
|
|
19
19
|
redirect
|
20
20
|
end
|
21
21
|
else
|
22
|
-
redirect_to :back, alert:
|
22
|
+
redirect_to :back, alert: 'Please check email and password.'
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -30,7 +30,7 @@ class UsersController < ApplicationController
|
|
30
30
|
if respond_to? :on_logout
|
31
31
|
on_logout
|
32
32
|
else
|
33
|
-
redirect_to :
|
33
|
+
redirect_to params[:redirect] || root_path
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: user_authentication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sujoy Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|