Skip to content

Commit e6b376e

Browse files
committed
docs: improve documentation
1 parent bac1e6a commit e6b376e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# basic-auth-connect
22

3-
Connect's Basic Auth middleware in its own module. This module is considered deprecated. You should instead create your own middleware with [basic-auth](https://github.com/visionmedia/node-basic-auth).
3+
Connect's Basic Auth middleware in its own module. You should consider to create your own middleware with [basic-auth](https://github.com/visionmedia/node-basic-auth).
44

55
## API
66

77
```js
88
var basicAuth = require('basic-auth-connect');
99
```
1010

11-
Sorry, couldn't think of a more clever name.
12-
1311
Simple username and password
1412

1513
```js
@@ -28,13 +26,17 @@ connect()
2826

2927
Async callback verification, accepting `fn(err, user)`.
3028

31-
```
29+
```js
3230
connect()
3331
.use(basicAuth(function(user, pass, fn){
3432
User.authenticate({ user: user, pass: pass }, fn);
3533
}))
3634
```
3735

36+
**Security Considerations**
37+
38+
Important: When using the callback method, it is recommended to use a time-safe comparison function like [crypto.timingSafeEqual](https://nodejs.org/api/crypto.html#cryptotimingsafeequala-b) to prevent timing attacks.
39+
3840
## License
3941

4042
[MIT](./LICENSE)

0 commit comments

Comments
 (0)