Skip to content

Commit b4043bb

Browse files
committed
Bumps version and adds more information about how to enable HTTP Auth via token.
1 parent 819c388 commit b4043bb

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Or install it yourself as:
2929
`~> 0.3` | `~> 3.4.0`
3030
`~> 0.4.0`, `< 0.4.9` | `~> 3.5.0`, `< 3.5.2`
3131
`~> 0.4.9` | `~> 3.5.2`
32-
`~> 0.5.x` | `>= 4.0.0`, `< 4.4.0`
32+
`~> 0.5.x`, `<= 1.0.0` | `>= 4.0.0`, `< 4.4.0`
3333

3434
## Usage
3535

@@ -66,6 +66,19 @@ Devise::TokenAuthenticatable.setup do |config|
6666
end
6767
```
6868

69+
Enable devise's HTTP Auth for the token strategy as shown below:
70+
71+
```ruby
72+
# initializers/devise.rb
73+
Devise.setup do |config|
74+
# ...
75+
config.http_authenticatable = true
76+
# or
77+
config.http_authenticatable = [:token]
78+
# ...
79+
end
80+
```
81+
6982
## Troubleshooting
7083

7184
##### 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?
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Devise
22
module TokenAuthenticatable
3-
VERSION = '0.5.3'.freeze
3+
VERSION = '1.0.0'.freeze
44
end
55
end

spec/support/rails_app/config/initializers/devise.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@
4848
# Tell if authentication through request.params is enabled. True by default.
4949
# config.params_authenticatable = true
5050

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

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

0 commit comments

Comments
 (0)