authic_client 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -0
- data/app/controllers/authic_client/sessions_controller.rb +3 -3
- data/app/helpers/authic_client/application_helper.rb +2 -2
- data/lib/authic_client/version.rb +1 -1
- data/lib/generators/templates/authic.rb +6 -4
- data/lib/generators/templates/omniauth.rb +1 -1
- data/test/dummy/app/controllers/welcome_controller.rb +1 -0
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -3,8 +3,8 @@ module AuthicClient
|
|
3
3
|
def create
|
4
4
|
user = User.find_for_authic_oauth(request.env["omniauth.auth"], current_user)
|
5
5
|
if user.persisted?
|
6
|
-
session[:
|
7
|
-
redirect_path ||= session[:
|
6
|
+
session[:authic_user_id] = user.id
|
7
|
+
redirect_path ||= session[:authic_return_to_this_url] ||= root_url
|
8
8
|
redirect_to redirect_path, :notice => "You have been successfully signed in"
|
9
9
|
else
|
10
10
|
redirect_to root_url
|
@@ -12,7 +12,7 @@ module AuthicClient
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def destroy
|
15
|
-
session[:
|
15
|
+
session[:authic_user_id] = nil
|
16
16
|
#TODO: Change to PROD url
|
17
17
|
redirect_path = "http://#{AuthicClient::AUTHIC_CLIENT_SUBDOMAIN}.authicstaging.com/authic_sign_out?&return_path=#{URI.escape root_url}"
|
18
18
|
redirect_to redirect_path
|
@@ -2,7 +2,7 @@ module AuthicClient
|
|
2
2
|
module ApplicationHelper
|
3
3
|
|
4
4
|
def current_user
|
5
|
-
@current_user ||= User.find(session[:
|
5
|
+
@current_user ||= User.find(session[:authic_user_id]) if session[:authic_user_id]
|
6
6
|
end
|
7
7
|
|
8
8
|
def signin_path
|
@@ -15,7 +15,7 @@ module AuthicClient
|
|
15
15
|
|
16
16
|
def login_required
|
17
17
|
unless current_user
|
18
|
-
session[:
|
18
|
+
session[:authic_return_to_this_url] = request.fullpath
|
19
19
|
redirect_to signin_path
|
20
20
|
end
|
21
21
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
module AuthicClient
|
2
|
+
# Authic config
|
3
|
+
AUTHIC_CLIENT_KEY ||= ENV['AUTHIC_CLIENT_KEY'] ||= 'E6FRBHNNhWDOMhubF9hfg4ibhuiHn4XMngkbXl5o'
|
4
|
+
AUTHIC_CLIENT_SECRET ||= ENV['AUTHIC_CLIENT_SECRET'] ||= 'YjpvSh7KqjnpTfhZgklBQqrpFRamz7354t9GzPoj'
|
5
|
+
AUTHIC_CLIENT_SUBDOMAIN ||= ENV['AUTHIC_CLIENT_SUBDOMAIN'] ||= 'dev'
|
6
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
2
2
|
|
3
3
|
#TODO: Change to PROD url
|
4
|
-
provider :authic,
|
4
|
+
provider :authic, AuthicClient::AUTHIC_CLIENT_KEY, AuthicClient::AUTHIC_CLIENT_SECRET, :subdomain => AuthicClient::AUTHIC_CLIENT_SUBDOMAIN, :domain => "authicstaging.com"
|
5
5
|
|
6
6
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: authic_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- authic
|
@@ -148,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
148
148
|
requirements:
|
149
149
|
- - ">="
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
hash:
|
151
|
+
hash: 2335199687854049895
|
152
152
|
segments:
|
153
153
|
- 0
|
154
154
|
version: "0"
|
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
157
|
requirements:
|
158
158
|
- - ">="
|
159
159
|
- !ruby/object:Gem::Version
|
160
|
-
hash:
|
160
|
+
hash: 2335199687854049895
|
161
161
|
segments:
|
162
162
|
- 0
|
163
163
|
version: "0"
|