Skip to content

Commit

Permalink
Bumps version and adds more information about how to enable HTTP Auth…
Browse files Browse the repository at this point in the history
… via token.
  • Loading branch information
baschtl committed Jun 3, 2017
1 parent 819c388 commit b4043bb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Or install it yourself as:
`~> 0.3` | `~> 3.4.0`
`~> 0.4.0`, `< 0.4.9` | `~> 3.5.0`, `< 3.5.2`
`~> 0.4.9` | `~> 3.5.2`
`~> 0.5.x` | `>= 4.0.0`, `< 4.4.0`
`~> 0.5.x`, `<= 1.0.0` | `>= 4.0.0`, `< 4.4.0`

## Usage

Expand Down Expand Up @@ -66,6 +66,19 @@ Devise::TokenAuthenticatable.setup do |config|
end
```

Enable devise's HTTP Auth for the token strategy as shown below:

```ruby
# initializers/devise.rb
Devise.setup do |config|
# ...
config.http_authenticatable = true
# or
config.http_authenticatable = [:token]
# ...
end
```

## Troubleshooting

##### Using a new user's auth token does not result in invalidating an old users session. How can I ignore session storage when using token authentication?
Expand Down
2 changes: 1 addition & 1 deletion lib/devise/token_authenticatable/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Devise
module TokenAuthenticatable
VERSION = '0.5.3'.freeze
VERSION = '1.0.0'.freeze
end
end
7 changes: 6 additions & 1 deletion spec/support/rails_app/config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@
# Tell if authentication through request.params is enabled. True by default.
# config.params_authenticatable = true

# Tell if authentication through HTTP Basic Auth is enabled. False by default.
# Tell if authentication through HTTP Auth is enabled. False by default.
# It can be set to an array that will enable http authentication only for the
# given strategies, for example, `config.http_authenticatable = [:database]` will
# enable it only for database authentication. The supported strategies are:
# :database = Support basic authentication with authentication key + password
# :token = Support token authentication
config.http_authenticatable = true

# If http headers should be returned for AJAX requests. True by default.
Expand Down

0 comments on commit b4043bb

Please sign in to comment.