Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
adamniedzielski committed Feb 2, 2018
2 parents b1468ff + 9b8227e commit 423359c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
@@ -1,8 +1,10 @@
language: ruby
before_install: gem update --system
rvm:
- "2.2.8"
- "2.3.5"
- "2.4.2"
- "2.5.0"
gemfile:
- "gemfiles/rails4.2.gemfile"
- "gemfiles/rails5.0.gemfile"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -40,7 +40,7 @@ end
2) Generate the model which stores authentication tokens. The model name is not important, but the Devise-enabled model should have association called ```authentication_tokens```.

```
rails g model AuthenticationToken body:string user:references last_used_at:datetime expires_in:integer ip_address:string user_agent:string
rails g model AuthenticationToken body:string:index user:references last_used_at:datetime expires_in:integer ip_address:string user_agent:string
```

```ruby
Expand Down
4 changes: 1 addition & 3 deletions lib/tiddle/token_issuer.rb
Expand Up @@ -35,9 +35,7 @@ def expire_token(resource, request)
def find_token(resource, token_from_headers)
token_class = authentication_token_class(resource)
token_body = Devise.token_generator.digest(token_class, :body, token_from_headers)
resource.authentication_tokens.detect do |token|
Devise.secure_compare(token.body, token_body)
end
resource.authentication_tokens.find_by(body: token_body)
end

def purge_old_tokens(resource)
Expand Down
2 changes: 1 addition & 1 deletion tiddle.gemspec
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '>= 2.2.0'

spec.add_dependency "devise", ">= 4.0.0.rc1", "< 4.4"
spec.add_dependency "devise", ">= 4.0.0.rc1", "< 4.5"
spec.add_dependency "activerecord", ">= 4.2.0"
spec.add_development_dependency "bundler", "~> 1.7"
spec.add_development_dependency "rake", "~> 12.0"
Expand Down

0 comments on commit 423359c

Please sign in to comment.