empower 0.1.2 → 0.2.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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4c3229553d50515a185e98428ca4b3712db0369
|
4
|
+
data.tar.gz: 0184e418539e3327d2ccf79a37ff368df57da3e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d711d0e818e0718e9e61946271bbdc7d9c6f7d4e8f80ff88ce5faae51570dfce3cc8d4ebdd039dd203a3e402733d9e16bef0dd4c03bccb30e2dbedae59fff86
|
7
|
+
data.tar.gz: fccf01a06fe48a48c1bd3b2c5e21a4c09396501524e74eea8d76cf8cbe201890f609983ffa282357a9c5945a63f1c231e9ef7b74826cc35f72f75b58bf3045cc
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -82,6 +82,17 @@ Otherwise, if you want to handle your own links, they would look like this:
|
|
82
82
|
<%= link_to 'Login', user_omniauth_authorize_path(:facebook) %>
|
83
83
|
```
|
84
84
|
|
85
|
+
Overriding Redirects
|
86
|
+
----------
|
87
|
+
|
88
|
+
When you are signed in successfully through Facebook, Empower uses Devise's
|
89
|
+
`after_sign_in_path_for` method. You can customize this method in your
|
90
|
+
application controller
|
91
|
+
|
92
|
+
[See this doc page](https://github.com/plataformatec/devise/wiki/How-To
|
93
|
+
:-redirect-to-a -specific-page-on-successful-sign-in#redirect-back-to-current-
|
94
|
+
page-after-oauth- signin) for more information.
|
95
|
+
|
85
96
|
Contributing
|
86
97
|
----------
|
87
98
|
|
@@ -1,29 +1,24 @@
|
|
1
|
-
require_dependency "
|
1
|
+
require_dependency "empower_controller"
|
2
2
|
|
3
|
-
|
4
|
-
class OmniauthCallbacksController < ApplicationController
|
3
|
+
class Empower::OmniauthCallbacksController < EmpowerController
|
5
4
|
|
6
|
-
|
7
|
-
|
5
|
+
def facebook
|
6
|
+
@user = User.from_omniauth(request.env["omniauth.auth"])
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
end
|
16
|
-
else
|
17
|
-
session["devise.facebook_data"] = request.env["omniauth.auth"]
|
18
|
-
redirect_to main_app.root_path
|
19
|
-
end
|
8
|
+
if @user.persisted?
|
9
|
+
sign_in @user #this will throw if @user is not activated
|
10
|
+
redirect_to after_sign_in_path_for(@user)
|
11
|
+
else
|
12
|
+
session["devise.facebook_data"] = request.env["omniauth.auth"]
|
13
|
+
redirect_to after_sign_in_path_for(@user)
|
20
14
|
end
|
15
|
+
end
|
21
16
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
end
|
17
|
+
def failure
|
18
|
+
redirect_to(
|
19
|
+
(session[:redirect] || main_app.root_path),
|
20
|
+
:alert => "Could not authenticate your request."
|
21
|
+
)
|
28
22
|
end
|
23
|
+
|
29
24
|
end
|
data/lib/empower/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: empower
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean C Davis
|
@@ -82,8 +82,8 @@ files:
|
|
82
82
|
- app/assets/images/empower/.keep
|
83
83
|
- app/assets/javascripts/empower/application.js
|
84
84
|
- app/assets/stylesheets/empower/application.css
|
85
|
-
- app/controllers/empower/application_controller.rb
|
86
85
|
- app/controllers/empower/omniauth_callbacks_controller.rb
|
86
|
+
- app/controllers/empower_controller.rb
|
87
87
|
- app/helpers/empower/application_helper.rb
|
88
88
|
- app/helpers/empower/omniauth_helper.rb
|
89
89
|
- app/views/layouts/empower/application.html.erb
|