@tidecloak/create-nextjs 0.12.14 → 0.12.16

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/README.md CHANGED
@@ -10,6 +10,8 @@ Jump to:
10
10
 
11
11
  Secure your Next.js app with TideCloak: authentication, session management, data encryption, and edge-middleware integration all in minutes.
12
12
 
13
+ [![Developer Walkthrough](http://img.youtube.com/vi/dVpDUF_XJdw/0.jpg)](https://www.youtube.com/watch?v=dVpDUF_XJdw "Provably secure your Next.js apps in 5 mins, with TideCloak")
14
+
13
15
  ### 1. Prerequisites
14
16
 
15
17
  Before you begin, ensure you have:
@@ -208,8 +210,7 @@ No additional install-middleware is included in `@tidecloak/nextjs`.
208
210
 
209
211
  #### Options
210
212
 
211
- * **`config`** (`TidecloakConfig`): Your Keycloak adapter JSON (downloaded from your TideCloak client settings).
212
- * **`publicRoutes`** (`RoutePattern[]`): Paths to bypass authentication (strings/globs/regex/functions).
213
+ * **`config`** (`TidecloakConfig`): Your Tidecloak adapter JSON (downloaded from your TideCloak client settings).
213
214
  * **`protectedRoutes`** (`ProtectedRoutesMap`): Map of path patterns to arrays of required roles.
214
215
  * **`onRequest`**<br>`(ctx: { token: string | null }, req: NextRequest) => NextResponse | void`<br>Hook before auth logic; can short-circuit by returning a `NextResponse`.
215
216
  * **`onSuccess`**<br>`(ctx: { payload: Record<string, any> }, req: NextRequest) => NextResponse | void`<br>Hook after successful auth & role checks; override the response by returning one.
@@ -222,12 +223,11 @@ Place the following `middleware.ts` at your project root (works for both Pages a
222
223
 
223
224
  ```ts
224
225
  import { NextResponse } from 'next/server';
225
- import keycloakConfig from './tidecloak.config.json';
226
+ import tidecloakConfig from './tidecloakAdapter.json';
226
227
  import { createTideCloakMiddleware } from '@tidecloak/nextjs/server/tidecloakMiddleware';
227
228
 
228
229
  export default createTideCloakMiddleware({
229
- config: keycloakConfig,
230
- publicRoutes: ['/', '/about'],
230
+ config: tidecloakConfig,
231
231
  protectedRoutes: {
232
232
  '/admin/*': ['admin'],
233
233
  '/api/private/*': ['user'],
@@ -289,7 +289,7 @@ export async function verifyTideCloakToken(config, token, allowedRoles = []) {
289
289
 
290
290
  **Parameters:**
291
291
 
292
- * `config` (`object`): Your TideCloak adapter JSON (parsed Keycloak config).
292
+ * `config` (`object`): Your TideCloak adapter JSON (parsed Tidecloak client adapter config).
293
293
  * `token` (`string`): Access token string to verify.
294
294
  * `allowedRoles` (`string[]`, optional): Array of realm or client roles; user must have at least one.
295
295
 
package/init/realm.json CHANGED
@@ -111,7 +111,7 @@
111
111
  "providerId": "declarative-user-profile",
112
112
  "config": {
113
113
  "kc.user.profile.config": [
114
- "{\"attributes\":[{\"name\":\"username\",\"displayName\":\"${username}\",\"validations\":{\"length\":{\"min\":3,\"max\":255},\"username-prohibited-characters\":{},\"up-username-not-idn-homograph\":{}},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"email\",\"displayName\":\"${email}\",\"validations\":{\"email\":{},\"length\":{\"max\":255}},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"firstName\",\"displayName\":\"${firstName}\",\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"lastName\",\"displayName\":\"${lastName}\",\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false}],\"groups\":[{\"name\":\"user-metadata\",\"displayHeader\":\"User metadata\",\"displayDescription\":\"Attributes, which refer to user metadata\"}]}"
114
+ "{\"attributes\":[{\"name\":\"username\",\"displayName\":\"${username}\",\"validations\":{\"length\":{\"min\":3,\"max\":255},\"username-prohibited-characters\":{},\"up-username-not-idn-homograph\":{}},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"email\",\"displayName\":\"${email}\",\"validations\":{\"email\":{},\"length\":{\"max\":255}},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"firstName\",\"displayName\":\"${firstName}\",\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"lastName\",\"displayName\":\"${lastName}\",\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false}],\"groups\":[{\"name\":\"user-metadata\",\"displayHeader\":\"User metadata\",\"displayDescription\":\"Attributes, which refer to user metadata\"}],\"unmanagedAttributePolicy\":\"ENABLED\"}"
115
115
  ]
116
116
  }
117
117
  }
package/init/tcinit.sh CHANGED
@@ -179,7 +179,7 @@ INVITE_LINK=$(curl -s -X POST \
179
179
  -d '["link-tide-account-action"]')
180
180
 
181
181
  echo "🔗 Invite link: ${INVITE_LINK}"
182
- echo "→ Send this link to the user so they can link their account."
182
+ echo "→ Use (or send) this URL to link the first admin to their account."
183
183
 
184
184
  MAX_TRIES=3
185
185
  attempt=1
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@tidecloak/create-nextjs",
3
- "version": "0.12.14",
3
+ "version": "0.12.16",
4
4
  "type": "module",
5
- "description": "Scaffold a TideCloak-ready Next.js app with optional IAM setup and working auth start building instantly with a live example",
5
+ "description": "Scaffold a TideCloak-ready Next.js app with optional IAM setup and working auth - start building instantly with a live example",
6
6
  "bin": {
7
7
  "create-nextjs": "./dist/cjs/create.cjs"
8
8
  },
@@ -95,7 +95,7 @@ const cardStyle = {
95
95
  borderRadius: '8px',
96
96
  boxShadow: '0 4px 12px rgba(0,0,0,0.1)',
97
97
  textAlign: 'center',
98
- maxWidth: '360px',
98
+ maxWidth: '660px',
99
99
  width: '100%',
100
100
  }
101
101
 
@@ -109,3 +109,4 @@ const buttonStyle = {
109
109
  color: '#fff',
110
110
  cursor: 'pointer',
111
111
  }
112
+
@@ -12,6 +12,6 @@
12
12
  "next": "14.x",
13
13
  "react": "18.x",
14
14
  "react-dom": "18.x",
15
- "@tidecloak/nextjs": "^0.12.14"
15
+ "@tidecloak/nextjs": "^0.12.16"
16
16
  }
17
17
  }
@@ -95,7 +95,7 @@ const cardStyle: React.CSSProperties = {
95
95
  borderRadius: '8px',
96
96
  boxShadow: '0 4px 12px rgba(0,0,0,0.1)',
97
97
  textAlign: 'center',
98
- maxWidth: '360px',
98
+ maxWidth: '660px',
99
99
  width: '100%',
100
100
  }
101
101
 
@@ -109,3 +109,4 @@ const buttonStyle: React.CSSProperties = {
109
109
  color: '#fff',
110
110
  cursor: 'pointer',
111
111
  }
112
+
@@ -12,7 +12,7 @@
12
12
  "next": "14.x",
13
13
  "react": "18.x",
14
14
  "react-dom": "18.x",
15
- "@tidecloak/nextjs": "^0.12.14"
15
+ "@tidecloak/nextjs": "^0.12.16"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/node": "24.0.13",