express-sweet 1.0.23 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -5
- package/dist/build.common.js +7 -7
- package/dist/build.esm.js +9 -9
- package/docs/img/logos/default-small.svg +3 -0
- package/docs/img/logos/default.svg +1 -0
- package/docs/img/logos/favicon.svg +3 -0
- package/docs/index.html +63 -13
- package/package.json +4 -5
- package/types/database/Database.d.ts +33 -33
- package/types/interfaces/AuthenticationOptions.d.ts +14 -0
- package/types/middlewares/Authentication.d.ts +2 -0
- package/types/package.d.ts +0 -1
- package/types/utils/isArray.d.ts +1 -1
- package/types/utils/isAsyncFunction.d.ts +1 -1
- package/types/utils/isObject.d.ts +1 -1
- package/types/utils/isString.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
-
## [1.0.24] - 2022/10/
|
|
4
|
+
## [1.0.24] - 2022/10/24
|
|
5
|
+
### Fixed
|
|
6
|
+
- Added is_ajax option to user authentication.
|
|
7
|
+
config/authentication.js:
|
|
8
|
+
```js
|
|
9
|
+
/**
|
|
10
|
+
* How to determine if it is an ajax request.
|
|
11
|
+
* The default is that if there is an XMLHttpRequest in the request header (req.xhr) returns true.
|
|
12
|
+
* For example, if there is no XMLHttpRequest in req(express.Request) and the Ajax endpoint starts with /api, a custom Ajax decision can be made like "return /^\/api\//.test(req.path)".
|
|
13
|
+
*
|
|
14
|
+
* @type {(req: express.Request) => boolean}
|
|
15
|
+
* @example
|
|
16
|
+
* is_ajax: req => {
|
|
17
|
+
* // If the request URL begins with /api, it is assumed to be Ajax.
|
|
18
|
+
* return /^\/api/.test(req.path);
|
|
19
|
+
* // return !!req.xhr;
|
|
20
|
+
* }
|
|
21
|
+
*/
|
|
22
|
+
is_ajax: req => !!req.xhr
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## [1.0.23] - 2022/10/20
|
|
5
26
|
### Fixed
|
|
6
27
|
- A request body object has been added to the parameters of the callback function for user authentication.
|
|
7
28
|
config/authentication.js:
|
|
@@ -33,10 +54,6 @@ All notable changes to this project will be documented in this file.
|
|
|
33
54
|
}
|
|
34
55
|
```
|
|
35
56
|
|
|
36
|
-
## [1.0.23] - 2022/10/5
|
|
37
|
-
### Fixed
|
|
38
|
-
- Methodical check of request URLs that do not require authentication.
|
|
39
|
-
|
|
40
57
|
## [1.0.22] - 2022/7/27
|
|
41
58
|
### Fixed
|
|
42
59
|
- You can now set hook functions that are called before the view is rendered.
|