robdimarco_authlogic_oauth2 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -46,6 +46,7 @@ Here's an example for Facebook:
46
46
  oauth2_client_secret "APPLICATION_SECRET"
47
47
  oauth2_site "https://graph.facebook.com"
48
48
  oauth2_scope "offline_access,email,user_birthday"
49
+ oauth2_cannot_find_record_message "We have no record of you in our database, please sign up first."
49
50
  end
50
51
 
51
52
  It's important to note here that if you don't request offline_access permissions from your OAuth2 provider the access token will expire either at a specific time or upon logout from the provider itself. Some providers allow refresh tokens to be issued, but some (Facebook, for example) does not. Refresh token handling hasn't been implemented in authlogic_oauth2 yet, so make sure you request offline_access.
@@ -44,6 +44,11 @@ module AuthlogicOauth2
44
44
  rw_config(:oauth2_scope, value, '')
45
45
  end
46
46
  alias_method :oauth2_scope=, :oauth2_scope
47
+
48
+ def oauth2_cannot_find_record_message(value = nil)
49
+ rw_config(:oauth2_cannot_find_record_message, value, "Could not find user in our database, have you registered with your Oauth2 account?")
50
+ end
51
+ alias_method :oauth2_cannot_find_record_message=, :oauth2_cannot_find_record_message
47
52
  end
48
53
 
49
54
  module Methods
@@ -92,7 +97,7 @@ module AuthlogicOauth2
92
97
  end
93
98
 
94
99
  if !attempted_record
95
- errors.add(:base, "Could not find user in our database, have you registered with your Oauth2 account?")
100
+ errors.add(:base, self.class.oauth2_cannot_find_record_message)
96
101
  end
97
102
  end
98
103
 
@@ -41,7 +41,7 @@ module AuthlogicOauth2
41
41
 
42
42
  MAJOR = 1
43
43
  MINOR = 1
44
- TINY = 3
44
+ TINY = 4
45
45
 
46
46
  # The current version as a Version instance
47
47
  CURRENT = new(MAJOR, MINOR, TINY)
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{robdimarco_authlogic_oauth2}
5
- s.version = "1.1.3"
5
+ s.version = "1.1.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Andrew Hite"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robdimarco_authlogic_oauth2
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 3
10
- version: 1.1.3
9
+ - 4
10
+ version: 1.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andrew Hite