authic_client 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -64,7 +64,6 @@ The initializer looks like:
64
64
  AUTHIC_CLIENT_KEY ||= ENV['AUTHIC_CLIENT_KEY'] ||= '< your authic client key >'
65
65
  AUTHIC_CLIENT_SECRET ||= ENV['AUTHIC_CLIENT_SECRET'] ||= '< your authic client secret >'
66
66
  AUTHIC_CLIENT_SUBDOMAIN ||= ENV['AUTHIC_CLIENT_SUBDOMAIN'] ||= '< your authic subdomain >'
67
- AUTHIC_CLIENT_FULL_URL = "https://#{AUTHIC_CLIENT_SUBDOMAIN}.authic.com"
68
67
  end
69
68
 
70
69
  Just replace the <XXXX> strings between the quotes with the values. There is no need to change any other part of this file.
@@ -5,16 +5,16 @@ class AuthicClient::SessionsController < ActionController::Base
5
5
  session[:authic_user_id] = user.id
6
6
  redirect_path ||= session[:authic_return_to_this_url] ||= root_url
7
7
  # make sure the return to session variable is nil so it cant accidently get re-used
8
- session[:authic_return_to_this_url] = nil
8
+ session[:authic_return_to_this_url] = nil
9
9
  redirect_to redirect_path, :notice => "You have been successfully signed in"
10
10
  else
11
- redirect_to root_url
11
+ redirect_to root_url
12
12
  end
13
13
  end
14
14
 
15
15
  def destroy
16
16
  reset_session
17
- redirect_path = "#{AuthicClient::AUTHIC_CLIENT_FULL_URL}/authic_sign_out?&return_path=#{URI.escape root_url}"
17
+ redirect_path = "#{AuthicClient::ApplicationHelper::AUTHIC_CLIENT_FULL_URL}/authic_sign_out?&return_path=#{URI.escape root_url}"
18
18
  redirect_to redirect_path
19
19
  end
20
20
  end
@@ -1,6 +1,8 @@
1
1
  module AuthicClient
2
2
  module ApplicationHelper
3
-
3
+
4
+ AUTHIC_CLIENT_FULL_URL = defined?(AuthicClient::FULL_URL) ? AuthicClient::FULL_URL : "https://#{AUTHIC_CLIENT_SUBDOMAIN}.authic.com"
5
+
4
6
  def current_user
5
7
  @current_user ||= ::User.find(session[:authic_user_id]) if session[:authic_user_id]
6
8
  end
@@ -12,13 +14,13 @@ module AuthicClient
12
14
  def signup_path
13
15
  "/auth/authic?&authic_action=signup"
14
16
  end
15
-
17
+
16
18
  def signin_iframe_path
17
- "#{AuthicClient::AUTHIC_CLIENT_FULL_URL}/v1/signin_iframe"
19
+ "#{AUTHIC_CLIENT_FULL_URL}/v1/signin_iframe"
18
20
  end
19
21
 
20
22
  def user_account_path
21
- "#{AuthicClient::AUTHIC_CLIENT_FULL_URL}/edit_account"
23
+ "#{AUTHIC_CLIENT_FULL_URL}/edit_account"
22
24
  end
23
25
 
24
26
  def login_required
@@ -1,3 +1,3 @@
1
1
  module AuthicClient
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -1,9 +1,6 @@
1
1
  module AuthicClient
2
2
  # Authic config
3
- AUTHIC_CLIENT_KEY ||= ENV['AUTHIC_CLIENT_KEY'] ||= '< your authic client key >'
4
- AUTHIC_CLIENT_SECRET ||= ENV['AUTHIC_CLIENT_SECRET'] ||= '< your authic client secret >'
3
+ AUTHIC_CLIENT_KEY ||= ENV['AUTHIC_CLIENT_KEY'] ||= '< your authic client key >'
4
+ AUTHIC_CLIENT_SECRET ||= ENV['AUTHIC_CLIENT_SECRET'] ||= '< your authic client secret >'
5
5
  AUTHIC_CLIENT_SUBDOMAIN ||= ENV['AUTHIC_CLIENT_SUBDOMAIN'] ||= '< your authic subdomain >'
6
- # Dont touch the FULL URL variable, you might break everything!
7
- AUTHIC_CLIENT_FULL_URL = "https://#{AUTHIC_CLIENT_SUBDOMAIN}.authic.com"
8
- # end dont touch
9
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.1.1
5
+ version: 0.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - authic
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2014-10-12 00:00:00 Z
13
+ date: 2014-10-18 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -151,7 +151,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
151
151
  requirements:
152
152
  - - ">="
153
153
  - !ruby/object:Gem::Version
154
- hash: 4008932432462106318
154
+ hash: -3325041478340093344
155
155
  segments:
156
156
  - 0
157
157
  version: "0"
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  requirements:
161
161
  - - ">="
162
162
  - !ruby/object:Gem::Version
163
- hash: 4008932432462106318
163
+ hash: -3325041478340093344
164
164
  segments:
165
165
  - 0
166
166
  version: "0"