user_mgmt 0.5.13 → 0.6.0
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.
@@ -2,18 +2,19 @@ module UserMgmt
|
|
2
2
|
module ApplicationHelper
|
3
3
|
|
4
4
|
def user_logged_in?
|
5
|
-
return cookies[:user_session_id]
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
return false if cookies[:user_session_id] == nil
|
6
|
+
status = user_info(cookies[:user_session_id])[:status]
|
7
|
+
if status == 200
|
8
|
+
return true
|
9
|
+
else
|
10
|
+
cookies.delete(:user_session_id)
|
11
|
+
return false
|
12
|
+
end
|
13
13
|
end
|
14
14
|
|
15
15
|
def current_user
|
16
|
-
|
16
|
+
return nil unless user_logged_in?
|
17
|
+
@current_user ||= user_info(cookies[:user_session_id])[:body]
|
17
18
|
end
|
18
19
|
|
19
20
|
def sign_up email, password, password_confirmation, host=UserMgmt.external_database_URI
|
data/lib/user_mgmt/version.rb
CHANGED