payload-zitadel-plugin 0.4.2 → 0.4.4

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.
Files changed (2) hide show
  1. package/README.md +21 -21
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -10,7 +10,7 @@ Thus, the user collection in PayloadCMS becomes just a shadow of the information
10
10
  ## Install
11
11
 
12
12
  ```shell
13
- pnpm add payload-zitadel-plugin@0.4.1
13
+ pnpm add payload-zitadel-plugin@0.4.4
14
14
  ```
15
15
 
16
16
  ## Configuration
@@ -24,7 +24,7 @@ plugin list.
24
24
  #### payload.config.ts
25
25
 
26
26
  ```typescript
27
- import {buildConfig} from 'payload/config'
27
+ import {buildConfig} from 'payload'
28
28
  import {zitadelPlugin} from 'payload-zitadel-plugin'
29
29
 
30
30
 
@@ -50,7 +50,7 @@ export default buildConfig({
50
50
  label: 'some custom label'
51
51
  }
52
52
  }
53
- */
53
+ */
54
54
 
55
55
  // set the name of the CustomStrategy in PayloadCMS - usually not necessary
56
56
  // strategyName: 'zitadel'
@@ -71,7 +71,7 @@ export default buildConfig({
71
71
  // interpolation text for the Login Button - "sign in with ..."
72
72
  label: 'Zitadel'
73
73
  }
74
- */
74
+ */
75
75
 
76
76
  // if you want to manually control what happens after a successful login
77
77
  // afterLogin: (req) => NextResponse.redirect('...')
@@ -90,7 +90,7 @@ export default buildConfig({
90
90
  keyId: '123456789012345678'
91
91
  key: '-----BEGIN RSA PRIVATE KEY----- ... ----END RSA PRIVATE KEY-----'
92
92
  }
93
- */
93
+ */
94
94
  })
95
95
  ],
96
96
  ...
@@ -111,42 +111,42 @@ ZITADEL_API_KEY='-----BEGIN RSA PRIVATE KEY----- ... ----END RSA PRIVATE KEY----
111
111
 
112
112
  or use the Next.js Config file:
113
113
 
114
- #### next.config.js
114
+ #### next.config.ts
115
115
 
116
116
  ```typescript
117
117
  import {withPayload} from '@payloadcms/next/withPayload'
118
118
 
119
- /** @type {import('next').NextConfig} */
120
- const nextConfig = {
119
+ export default withPayload({
120
+ ...,
121
121
  env: {
122
122
  ZITADEL_URL: 'https://idp.zitadel.url',
123
123
  ZITADEL_CLIENT_ID: '123456789012345678@project_name',
124
124
  ZITADEL_API_CLIENT_ID: '123456789123456789@project_name',
125
125
  ZITADEL_API_KEY_ID: '123456789012345678',
126
126
  ZITADEL_API_KEY: '-----BEGIN RSA PRIVATE KEY----- ... ----END RSA PRIVATE KEY-----'
127
- }
128
- }
129
-
130
- export default withPayload(nextConfig)
127
+ },
128
+ ...
129
+ })
131
130
  ```
132
131
 
133
132
  ### further configuration
134
133
 
135
- If you want to use the Zitadel profile picture as the avatar in PayloadCMS (`disableAvatar != true`),
134
+ If you want to use the Zitadel profile picture as the avatar in PayloadCMS,
136
135
  you have to manually add the asset URL to the Next.js config file.
137
136
 
137
+ For a proper logout you have to add the `end_session` redirect.
138
+
138
139
  Also, if you want to automatically redirect to Zitadel without asking the user to click on the login button,
139
140
  you have to add the redirect manually to the Next.js config file.
140
141
 
141
- For a proper logout you also have to add the `end_session` redirect.
142
-
143
- #### next.config.js
142
+ #### next.config.ts
144
143
 
145
144
  ```typescript
146
145
  import {withPayload} from '@payloadcms/next/withPayload'
147
146
 
148
- /** @type {import('next').NextConfig} */
149
- const nextConfig = {
147
+ export default withPayload({
148
+ ...,
149
+
150
150
  // if Avatar enabled:
151
151
  // allow loading assets like profile pictures from Zitadel
152
152
  images: {
@@ -191,11 +191,11 @@ const nextConfig = {
191
191
  permanent: false
192
192
  }
193
193
  ]
194
- }
194
+ },
195
195
 
196
- }
196
+ ...
197
197
 
198
- export default withPayload(nextConfig)
198
+ })
199
199
  ```
200
200
 
201
201
  ## For an example look in this repository at the `dev` directory!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payload-zitadel-plugin",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "plugin for Payload CMS, which enables authentication via Zitadel IdP",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -36,19 +36,19 @@
36
36
  "dist"
37
37
  ],
38
38
  "dependencies": {
39
- "@payloadcms/next": "^3.12.0",
40
- "@payloadcms/translations": "^3.12.0",
41
- "@payloadcms/ui": "^3.12.0",
39
+ "@payloadcms/next": "^3.14.0",
40
+ "@payloadcms/translations": "^3.14.0",
41
+ "@payloadcms/ui": "^3.14.0",
42
42
  "jose": "^5.9.6",
43
43
  "next": "^15.1.3",
44
- "payload": "^3.12.0",
44
+ "payload": "^3.14.0",
45
45
  "react": "^19.0.0",
46
46
  "react-dom": "^19.0.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@swc/cli": "^0.5.2",
50
50
  "@swc/core": "^1.10.4",
51
- "@types/node": "^22.10.2",
51
+ "@types/node": "^22.10.5",
52
52
  "@types/react": "^19.0.2",
53
53
  "@types/react-dom": "^19.0.2",
54
54
  "rimraf": "^6.0.1",