payload 1.1.22 → 1.1.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/dist/admin/components/forms/useField/index.js +1 -1
- package/dist/auth/strategies/jwt.js +3 -5
- package/docs/admin/overview.mdx +1 -1
- package/docs/authentication/overview.mdx +1 -1
- package/docs/fields/array.mdx +1 -1
- package/docs/fields/blocks.mdx +1 -1
- package/docs/fields/rich-text.mdx +3 -3
- package/docs/fields/tabs.mdx +1 -1
- package/docs/upload/overview.mdx +1 -1
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@ const useField = (options) => {
|
|
|
25
25
|
const val = (e && e.target) ? e.target.value : e;
|
|
26
26
|
if (!modified && !disableModifyingForm) {
|
|
27
27
|
if (typeof setModified === 'function') {
|
|
28
|
-
setModified(true);
|
|
28
|
+
Promise.resolve(() => setModified(true));
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
dispatchField({
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const url_1 = __importDefault(require("url"));
|
|
7
7
|
const passport_jwt_1 = __importDefault(require("passport-jwt"));
|
|
8
|
-
const findByID_1 = __importDefault(require("../../collections/operations/findByID"));
|
|
9
8
|
const getExtractJWT_1 = __importDefault(require("../getExtractJWT"));
|
|
10
9
|
const JwtStrategy = passport_jwt_1.default.Strategy;
|
|
11
10
|
exports.default = ({ secret, config, collections }) => {
|
|
@@ -22,11 +21,10 @@ exports.default = ({ secret, config, collections }) => {
|
|
|
22
21
|
const collection = collections[token.collection];
|
|
23
22
|
const parsedURL = url_1.default.parse(req.url);
|
|
24
23
|
const isGraphQL = parsedURL.pathname === config.routes.graphQL;
|
|
25
|
-
const user = await
|
|
24
|
+
const user = await req.payload.findByID({
|
|
26
25
|
id: token.id,
|
|
27
|
-
collection,
|
|
26
|
+
collection: token.collection,
|
|
28
27
|
req,
|
|
29
|
-
overrideAccess: true,
|
|
30
28
|
depth: isGraphQL ? 0 : collection.config.auth.depth,
|
|
31
29
|
});
|
|
32
30
|
if (user && (!collection.config.auth.verify || user._verified)) {
|
|
@@ -43,4 +41,4 @@ exports.default = ({ secret, config, collections }) => {
|
|
|
43
41
|
}
|
|
44
42
|
});
|
|
45
43
|
};
|
|
46
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiand0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2F1dGgvc3RyYXRlZ2llcy9qd3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSw4Q0FBc0I7QUFDdEIsZ0VBQTREO0FBRzVELHFFQUE2QztBQUU3QyxNQUFNLFdBQVcsR0FBRyxzQkFBVyxDQUFDLFFBQVEsQ0FBQztBQUV6QyxrQkFBZSxDQUFDLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBRSxXQUFXLEVBQVcsRUFBb0IsRUFBRTtJQUM1RSxNQUFNLElBQUksR0FBb0I7UUFDNUIsaUJBQWlCLEVBQUUsSUFBSTtRQUN2QixjQUFjLEVBQUUsSUFBQSx1QkFBYSxFQUFDLE1BQU0sQ0FBQztRQUNyQyxXQUFXLEVBQUUsTUFBTTtLQUNwQixDQUFDO0lBRUYsT0FBTyxJQUFJLFdBQVcsQ0FBQyxJQUFJLEVBQUUsS0FBSyxFQUFFLEdBQUcsRUFBRSxLQUFLLEVBQUUsSUFBSSxFQUFFLEVBQUU7UUFDdEQsSUFBSSxHQUFHLENBQUMsSUFBSSxFQUFFO1lBQ1osSUFBSSxDQUFDLElBQUksRUFBRSxHQUFHLENBQUMsSUFBSSxDQUFDLENBQUM7U0FDdEI7UUFFRCxJQUFJO1lBQ0YsTUFBTSxVQUFVLEdBQUcsV0FBVyxDQUFDL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BQztBQUNMLENBQUMsQ0FBQyJ9
|
package/docs/admin/overview.mdx
CHANGED
|
@@ -14,7 +14,7 @@ The Payload Admin panel is built with Webpack, code-split, highly performant (ev
|
|
|
14
14
|
The Admin panel is meant to be simple enough to give you a starting point but not bring too much complexity, so that you can easily customize it to suit the needs of your application and your editors.
|
|
15
15
|
</Banner>
|
|
16
16
|
|
|
17
|
-

|
|
17
|
+

|
|
18
18
|
|
|
19
19
|
*Screenshot of the Admin panel while editing a document from an example `AllFields` collection*
|
|
20
20
|
|
|
@@ -12,7 +12,7 @@ keywords: authentication, config, configuration, overview, documentation, Conten
|
|
|
12
12
|
|
|
13
13
|
Authentication is used within the Payload Admin panel itself as well as throughout your app(s) themselves however you determine necessary.
|
|
14
14
|
|
|
15
|
-

|
|
15
|
+

|
|
16
16
|
*Admin panel screenshot depicting an Admins Collection with Auth enabled*
|
|
17
17
|
|
|
18
18
|
**Here are some common use cases of Authentication outside of Payload's dashboard itself:**
|
package/docs/fields/array.mdx
CHANGED
|
@@ -16,7 +16,7 @@ keywords: array, fields, config, configuration, documentation, Content Managemen
|
|
|
16
16
|
- Navigational structures where editors can specify nav items containing pages ([relationship field](/docs/fields/relationship)), an "open in new tab" [checkbox field](/docs/fields/checkbox)
|
|
17
17
|
- Event agenda "timeslots" where you need to specify start & end time ([date field](/docs/fields/date)), label ([text field](/docs/fields/text)), and Learn More page [relationship](/docs/fields/relationship)
|
|
18
18
|
|
|
19
|
-

|
|
19
|
+

|
|
20
20
|
*Admin panel screenshot of an Array field with a Row containing two text fields, a read-only text field and a checkbox*
|
|
21
21
|
|
|
22
22
|
### Config
|
package/docs/fields/blocks.mdx
CHANGED
|
@@ -16,7 +16,7 @@ keywords: blocks, fields, config, configuration, documentation, Content Manageme
|
|
|
16
16
|
- A form builder tool where available block configs might be `Text`, `Select`, or `Checkbox`.
|
|
17
17
|
- Virtual event agenda "timeslots" where a timeslot could either be a `Break`, a `Presentation`, or a `BreakoutSession`.
|
|
18
18
|
|
|
19
|
-

|
|
19
|
+

|
|
20
20
|
*Admin panel screenshot of a Blocks field type with Call to Action and Number block examples*
|
|
21
21
|
|
|
22
22
|
|
|
@@ -81,17 +81,17 @@ Set this property to `true` to hide this field's gutter within the admin panel.
|
|
|
81
81
|
|
|
82
82
|
This allows [fields](/docs/fields/overview) to be saved as extra fields on a link inside the Rich Text Editor. When this is present, the fields will render inside a modal that can be opened by clicking the "edit" button on the link element.
|
|
83
83
|
|
|
84
|
-

|
|
84
|
+

|
|
85
85
|
*RichText link with custom fields*
|
|
86
86
|
|
|
87
87
|
**`upload.collections[collection-name].fields`**
|
|
88
88
|
|
|
89
89
|
This allows [fields](/docs/fields/overview) to be saved as meta data on an upload field inside the Rich Text Editor. When this is present, the fields will render inside a modal that can be opened by clicking the "edit" button on the upload element.
|
|
90
90
|
|
|
91
|
-

|
|
91
|
+

|
|
92
92
|
*RichText field using the upload element*
|
|
93
93
|
|
|
94
|
-

|
|
94
|
+

|
|
95
95
|
*RichText upload element modal displaying fields from the config*
|
|
96
96
|
|
|
97
97
|
### Relationship element
|
package/docs/fields/tabs.mdx
CHANGED
|
@@ -10,7 +10,7 @@ keywords: tabs, fields, config, configuration, documentation, Content Management
|
|
|
10
10
|
The Tabs field is presentational-only and only affects the Admin panel (unless a tab is named). By using it, you can place fields within a nice layout component that separates certain sub-fields by a tabbed interface.
|
|
11
11
|
</Banner>
|
|
12
12
|
|
|
13
|
-

|
|
13
|
+

|
|
14
14
|
*Tabs field type used to separate Hero fields from Page Layout*
|
|
15
15
|
|
|
16
16
|
### Config
|
package/docs/upload/overview.mdx
CHANGED
|
@@ -12,7 +12,7 @@ keywords: uploads, images, media, overview, documentation, Content Management Sy
|
|
|
12
12
|
control.
|
|
13
13
|
</Banner>
|
|
14
14
|
|
|
15
|
-

|
|
15
|
+

|
|
16
16
|
_Admin panel screenshot depicting a Media Collection with Upload enabled_
|
|
17
17
|
|
|
18
18
|
**Here are some common use cases of Uploads:**
|