Skip to content

Commit

Permalink
Added auth example with Bearer Token
Browse files Browse the repository at this point in the history
chai-http supports Authorization with Bearer Token. But, this feature is not mentioned anywhere on the site or readme file. 
This would be useful for many developers & Tester.

Ref: https://github.com/chaijs/chai-http/blob/master/dist/chai-http.js#L3359
  • Loading branch information
keyuls authored Feb 8, 2021
1 parent 601854f commit b2f4cd4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ chai.request(app)
chai.request(app)
.get('/protected')
.auth('user', 'pass')

// Authenticate with Bearer Token
chai.request(app)
.get('/protected')
.auth(accessToken, { type: 'bearer' })

```

`.query()`
Expand Down

0 comments on commit b2f4cd4

Please sign in to comment.