devise_oauth2_providable 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -55,6 +55,14 @@ class User
55
55
  end
56
56
  ```
57
57
 
58
+ #### (optional) Configure token expiration settings
59
+ ```ruby
60
+ # config/application.rb
61
+ config.devise_oauth2_providable.access_token_expires_in = 1.second # 15.minute default
62
+ config.devise_oauth2_providable.refresh_token_expires_in = 1.minute # 1.month default
63
+ config.devise_oauth2_providable.authorization_token_expires_in = 5.seconds # 1.minute default
64
+ ```
65
+
58
66
  ## Models
59
67
 
60
68
  ### Client
@@ -5,7 +5,7 @@ class Devise::Oauth2Providable::Client < ActiveRecord::Base
5
5
 
6
6
  before_validation :init_identifier, :on => :create, :unless => :identifier?
7
7
  before_validation :init_secret, :on => :create, :unless => :secret?
8
- validates :website, :redirect_uri, :secret, :presence => true
8
+ validates :website, :secret, :presence => true
9
9
  validates :name, :presence => true, :uniqueness => true
10
10
  validates :identifier, :presence => true, :uniqueness => true
11
11
 
@@ -1,5 +1,5 @@
1
1
  module Devise
2
2
  module Oauth2Providable
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
@@ -4,13 +4,13 @@ describe Devise::Oauth2Providable::Client do
4
4
  it { Devise::Oauth2Providable::Client.table_name.should == 'oauth2_clients' }
5
5
 
6
6
  describe 'basic client instance' do
7
- subject { Devise::Oauth2Providable::Client.create! :name => 'test', :redirect_uri => 'http://localhost:3000', :website => 'http://localhost' }
7
+ with :client
8
+ subject { client }
8
9
  it { should validate_presence_of :name }
9
10
  it { should validate_uniqueness_of :name }
10
11
  it { should allow_mass_assignment_of :name }
11
12
  it { should validate_presence_of :website }
12
13
  it { should allow_mass_assignment_of :website }
13
- it { should validate_presence_of :redirect_uri }
14
14
  it { should allow_mass_assignment_of :redirect_uri }
15
15
  it { should validate_uniqueness_of :identifier }
16
16
  it { should have_db_index(:identifier).unique(true) }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_oauth2_providable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
9
+ - 3
10
+ version: 1.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Sonnek