@payloadcms/codemod 4.0.0-internal.1ccb6d5 → 4.0.0-internal.2071af3
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/runbook/v4.mdx +7 -1
- package/package.json +1 -1
package/dist/runbook/v4.mdx
CHANGED
|
@@ -120,6 +120,12 @@ A token is also rejected if its `collection` is not auth-enabled or has `disable
|
|
|
120
120
|
|
|
121
121
|
See [Token Data](../authentication/token-data) for the full token data shape.
|
|
122
122
|
|
|
123
|
+
### Sessions track their refreshes
|
|
124
|
+
|
|
125
|
+
Auth collections with `useSessions` (the default) now store two more fields on each session, `refreshCount` and `refreshedAt`. [Refresh tokens](../authentication/overview#refresh-tokens) use them to tell the latest refresh token apart from older ones.
|
|
126
|
+
|
|
127
|
+
On SQL adapters this adds two columns to each `<collection>_sessions` table, so existing projects need a database migration. In development the schema is pushed automatically; in production, generate a migration with `payload migrate:create` and run `payload migrate`. Existing sessions keep working, since an empty `refreshCount` counts as `0`. MongoDB needs no migration.
|
|
128
|
+
|
|
123
129
|
### Local API access is now enforced by default #overrideaccess-now-defaults-to-false-on-local-api-operations
|
|
124
130
|
|
|
125
131
|
`overrideAccess` now defaults to `false` on Local API operations, so omitting it respects Access Control instead. Operations that do not expose `overrideAccess`, and operations such as `resetPassword` where it was already required or did not default to `true`, are unaffected by this change.
|
|
@@ -2159,7 +2165,7 @@ The `alwaysInsertFields` option (on `cloudStoragePlugin` and every `storage-*` a
|
|
|
2159
2165
|
|
|
2160
2166
|
### Upload collections retain originals and file history
|
|
2161
2167
|
|
|
2162
|
-
Upload collections now store `original` metadata and a `prefix` and `_objectKey` for each stored file (the main file, `original`, and each variant), so saved versions can find their files. New uploads keep their
|
|
2168
|
+
Upload collections now store `original` metadata and a `prefix` and `_objectKey` for each stored file (the main file, `original`, and each variant), so saved versions can find their files. New uploads keep their uploaded filename. With a storage adapter, each new file is stored under its own `_objectKey` folder, so update any code or infrastructure that relies on the old object key. When a processed main file and its original share a filename, request the original with `?original=true`; `original.url` already includes it. With local storage, the original gets a counter name instead (for example `photo-1.png`). Files saved by earlier v4 beta releases with an `-original` filename keep that name and are still served. Custom storage adapters should handle the new `params.isOriginal` in `staticHandler`; see [Custom Storage Adapters](../upload/storage-adapters#custom-storage-adapters).
|
|
2163
2169
|
|
|
2164
2170
|
**Postgres and SQLite:** after updating, run `payload migrate:create`, check that it adds these columns to each upload collection table and its versions table, then run `payload migrate`. Existing rows keep `null` values until their next write.
|
|
2165
2171
|
|
package/package.json
CHANGED