@chemmangat/msal-next 5.0.0 → 5.0.1

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 +27 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -6,7 +6,7 @@ Microsoft/Azure AD authentication for Next.js App Router. Minimal setup, full Ty
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
  [![Security](https://img.shields.io/badge/Security-A+-green.svg)](./SECURITY.md)
8
8
 
9
- **Current version: 4.2.1**
9
+ **Current version: 5.0.0**
10
10
 
11
11
  ---
12
12
 
@@ -16,6 +16,20 @@ Microsoft/Azure AD authentication for Next.js App Router. Minimal setup, full Ty
16
16
  npm install @chemmangat/msal-next @azure/msal-browser @azure/msal-react
17
17
  ```
18
18
 
19
+ Or scaffold everything automatically with the CLI (Node.js 18+ required):
20
+
21
+ ```bash
22
+ npx @chemmangat/msal-next-cli init
23
+ ```
24
+
25
+ The `init` command interactively asks for your client ID, tenant ID, authority type, and cache location, then creates `.env.local`, updates `app/layout.tsx` with `MSALProvider`, and generates a starter `app/auth/page.tsx`.
26
+
27
+ To migrate an existing project from popup-based auth to redirect:
28
+
29
+ ```bash
30
+ npx @chemmangat/msal-next-cli migrate
31
+ ```
32
+
19
33
  ---
20
34
 
21
35
  ## Quick Start
@@ -179,6 +193,12 @@ Protects content and redirects unauthenticated users to login.
179
193
  onSwitch={(account) => {}}
180
194
  onAdd={() => {}}
181
195
  onRemove={(account) => {}}
196
+ // v5.0.0 — custom account row rendering
197
+ renderAccount={(account, isActive) => (
198
+ <div style={{ fontWeight: isActive ? 'bold' : 'normal' }}>
199
+ {account.name} ({account.username})
200
+ </div>
201
+ )}
182
202
  />
183
203
  ```
184
204
 
@@ -192,6 +212,12 @@ Protects content and redirects unauthenticated users to login.
192
212
  clickToSwitch
193
213
  orientation="vertical" // 'vertical' | 'horizontal'
194
214
  onAccountClick={(account) => {}}
215
+ // v5.0.0 — custom account row rendering
216
+ renderAccount={(account, isActive) => (
217
+ <div style={{ color: isActive ? 'blue' : 'black' }}>
218
+ {account.name} — {account.username}
219
+ </div>
220
+ )}
195
221
  />
196
222
  ```
197
223
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chemmangat/msal-next",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Production-ready Microsoft/Azure AD authentication for Next.js App Router. Zero-config setup, TypeScript-first, multi-account support, auto token refresh. The easiest way to add Microsoft login to your Next.js app.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",