user_mgmt 0.9.1 → 0.9.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2fcb1d160ddace35d83ecbf4dfb6530ca3a0ddb
|
4
|
+
data.tar.gz: 346776791db5b53089be3d4e66b999cf1918ab2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7b68783c380219488e1c3659af4e729922cde2df68469dd4bc9289687f43173991a90ef46421457f7c86763ffb0b9cad84bbdd3586cf7adcac117dbf654f2b7
|
7
|
+
data.tar.gz: c35bc5a5d167ad7f81b3962f084223e8551a858cba38c500422230b63e4a066c46580121a64f1a7d834bb37f45ff1bc8ef951b0ad6800ab295f8589c705cbc2e
|
@@ -41,14 +41,23 @@ module UserMgmt
|
|
41
41
|
@provider = "windows_live"
|
42
42
|
end
|
43
43
|
|
44
|
+
@umid = current_user["umid"] if user_logged_in?
|
45
|
+
|
44
46
|
response = log_in_oauth @uid, @provider
|
45
47
|
|
46
48
|
# if user logged in succesfully, just redirect to main page,
|
47
49
|
# otherwise it means the user doesn't exist yet, so continue
|
48
50
|
# normaly (user will be asked for his email).
|
49
51
|
if response[:status] == "200"
|
50
|
-
|
51
|
-
|
52
|
+
if @umid
|
53
|
+
redirect_to main_app.root_path, flash: { error: "User already signed up for the app!" }
|
54
|
+
else
|
55
|
+
cookies.permanent[:user_session_id] = response[:body]["session"]
|
56
|
+
redirect_to main_app.root_path, flash: { success: "User logged in!" }
|
57
|
+
end
|
58
|
+
elsif @umid
|
59
|
+
add_strategy @uid, @provider, @umid, cookies[:user_session_id]
|
60
|
+
redirect_to main_app.root_path, flash: { success: "Strategy added successfully!" }
|
52
61
|
end
|
53
62
|
|
54
63
|
end
|
@@ -24,8 +24,4 @@
|
|
24
24
|
= link_to image_tag('user_mgmt/normal/yahoo-copied.jpg', class: "menu_icon", height: '45', width: '45'), "auth/yahoo"
|
25
25
|
= link_to image_tag('user_mgmt/normal/gmail-copied.png', class: "menu_icon", height: '45', width: '45'), "auth/google_oauth2"
|
26
26
|
.password_reset
|
27
|
-
= link_to 'forgot your password?', password_reset_request_path
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
= link_to 'forgot your password?', password_reset_request_path
|
data/config/routes.rb
CHANGED
@@ -12,6 +12,7 @@ UserMgmt::Engine.routes.draw do
|
|
12
12
|
post '/send_password_reset' => 'registrations#send_password_reset', as: 'send_password_reset'
|
13
13
|
get '/password_reset_request' => 'registrations#password_reset_request', as: 'password_reset_request'
|
14
14
|
post '/send_reset_request' => 'registrations#send_reset_request', as: 'send_reset_request'
|
15
|
+
get '/add_strategy' => 'registrations#add_strategy', as: 'add_strategy'
|
15
16
|
|
16
17
|
get 'auth/:provider/callback' => 'sessions#oauth_email', as: 'oauth_email'
|
17
18
|
get 'auth/failure' => 'application#main_page', as: 'cancel'
|
data/lib/user_mgmt/version.rb
CHANGED