Fix authentication token description
This commit is contained in:
parent
aabf5d737a
commit
d60765880f
3 changed files with 16 additions and 10 deletions
|
@ -1,17 +1,15 @@
|
|||
class APIController < ApplicationController
|
||||
AUTHENTICATION_TOKEN_DESCRIPTION = <<-EOS
|
||||
L'authentification de l'API se fait via un header HTTP :
|
||||
|
||||
```
|
||||
Authorization: Bearer <Token administrateur>
|
||||
```
|
||||
EOS
|
||||
|
||||
before_action :authenticate_user
|
||||
before_action :default_format_json
|
||||
|
||||
resource_description do
|
||||
description <<-EOS
|
||||
L'authentification de l'API se fait via un header HTTP :
|
||||
|
||||
```
|
||||
Authorization: Bearer <Token administrateur>
|
||||
```
|
||||
EOS
|
||||
end
|
||||
|
||||
def authenticate_user
|
||||
if !valid_token?
|
||||
request_http_token_authentication
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue