Skip to content

Commit

Permalink
Merge pull request ruby-grape#2037 from ruby-grape/doc
Browse files Browse the repository at this point in the history
Remove a code example for comparing passwords in Basic authentication
  • Loading branch information
dblock authored Apr 11, 2020
2 parents a56fb88 + 1b91336 commit 78002f2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3189,14 +3189,13 @@ applies to the current namespace and any children, but not parents.
```ruby
http_basic do |username, password|
# verify user's password here
{ 'test' => 'password1' }[username] == password
# IMPORTANT: make sure you use a comparison method which isn't prone to a timing attack
end
```

```ruby
http_digest({ realm: 'Test Api', opaque: 'app secret' }) do |username|
# lookup the user's password here
{ 'user1' => 'password1' }[username]
end
```

Expand Down

0 comments on commit 78002f2

Please sign in to comment.