user_mgmt 0.8.3.1 → 0.9
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: 0ca7d16c042b6a54c82a91fc4c2d2a977dfdc53e
|
4
|
+
data.tar.gz: 4e9f10788c72a332678ec63a46c720d703b5f44b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cd9e510930130724f60d3b9d99d6cabb66b9c913c0d388ff59a2c5c2cf46e3a4addb13b528561384dc5d334c109a1796005de99885f93639549b26065d940fa
|
7
|
+
data.tar.gz: 3d8b888161ab62e3e467df83af26444d4d2b7280df31a6e4b89ad0037878c75d63e8802a735bb7560a43373b9a6f9399edf7aad38f0f0c368de4870e2f514aa2
|
@@ -15,7 +15,7 @@ module UserMgmt
|
|
15
15
|
|
16
16
|
if response[:status] == "200"
|
17
17
|
flash[:success] = "User was created succesfully!"
|
18
|
-
|
18
|
+
session.permanent[:user_session_id] = response[:body]["session"]
|
19
19
|
redirect_to main_app.root_path
|
20
20
|
else
|
21
21
|
flash[:error] = response[:body]
|
@@ -17,7 +17,7 @@ module UserMgmt
|
|
17
17
|
|
18
18
|
if response[:status] == "200"
|
19
19
|
flash[:success] = "User logged in!"
|
20
|
-
|
20
|
+
session.permanent[:user_session_id] = response[:body]["session"]
|
21
21
|
redirect_to main_app.root_path
|
22
22
|
else
|
23
23
|
flash[:error] = response[:body]
|
@@ -52,11 +52,11 @@ module UserMgmt
|
|
52
52
|
if @umid
|
53
53
|
redirect_to main_app.root_path, flash: { error: "User already signed up for the app!" }
|
54
54
|
else
|
55
|
-
|
55
|
+
session.permanent[:user_session_id] = response[:body]["session"]
|
56
56
|
redirect_to main_app.root_path, flash: { success: "User logged in!" }
|
57
57
|
end
|
58
58
|
elsif @umid
|
59
|
-
add_strategy @uid, @provider, @umid,
|
59
|
+
add_strategy @uid, @provider, @umid, session[:user_session_id]
|
60
60
|
redirect_to main_app.root_path, flash: { success: "Strategy added successfully!" }
|
61
61
|
end
|
62
62
|
|
@@ -72,7 +72,7 @@ module UserMgmt
|
|
72
72
|
redirect_to sign_up_path, flash: { error: response[:body] }
|
73
73
|
else
|
74
74
|
response = log_in_oauth params["uid"], params["provider"].to_sym
|
75
|
-
|
75
|
+
session.permanent[:user_session_id] = response[:body]["session"]
|
76
76
|
redirect_to main_app.root_path, flash: { success: "User logged in!" }
|
77
77
|
end
|
78
78
|
|
@@ -80,7 +80,7 @@ module UserMgmt
|
|
80
80
|
|
81
81
|
# GET /user/log_out
|
82
82
|
def destroy
|
83
|
-
|
83
|
+
session.delete(:user_session_id)
|
84
84
|
redirect_to main_app.root_path, flash: { success: "Logged out!" }
|
85
85
|
end
|
86
86
|
|
@@ -2,18 +2,18 @@ module UserMgmt
|
|
2
2
|
module ApplicationHelper
|
3
3
|
|
4
4
|
def user_logged_in?
|
5
|
-
return false if
|
6
|
-
status = user_info(
|
5
|
+
return false if session[:user_session_id] == nil
|
6
|
+
status = user_info(session[:user_session_id])[:status]
|
7
7
|
if status == "200"
|
8
8
|
return true
|
9
9
|
else
|
10
|
-
|
10
|
+
session.delete(:user_session_id)
|
11
11
|
return false
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
def current_user
|
16
|
-
@current_user ||= user_info(
|
16
|
+
@current_user ||= user_info(session[:user_session_id])[:body] unless session[:user_session_id] == nil
|
17
17
|
end
|
18
18
|
|
19
19
|
def sign_up email, password, password_confirmation, admin=false, host=UserMgmt.external_database_URI
|
data/lib/user_mgmt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: user_mgmt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.9'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danilo Faria, Fernando Gorodscy, Josh Leslie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sqlite3
|