@lpshanley/oidc-start-react 0.1.0-next.1 → 0.2.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lucas Shanley
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -4,12 +4,14 @@ Add OpenID Connect sign-in to a TanStack Start app. Loaders can read the current
4
4
 
5
5
  This guide adds two routes to an existing app. The home page at `/` shows who is signed in. The callback at `/callback` receives the browser when the provider sends it back. [Complete example app](https://github.com/lpshanley/oidc-start/tree/main/examples/tanstack-start)
6
6
 
7
+ For multi-replica deployment, see the [production guide](https://github.com/lpshanley/oidc-start/blob/main/docs/production.md) and [tested PostgreSQL example](https://github.com/lpshanley/oidc-start/tree/main/examples/postgres).
8
+
7
9
  ## 1. Install and configure the server
8
10
 
9
- Use Node.js 22.12 or newer. Your app supplies `@tanstack/react-start@^1.169.2` and `@tanstack/react-router@^1.170.44`. Install both OIDC packages because your app imports the core directly.
11
+ Use Node.js 22.12 or newer. Your app supplies `@tanstack/react-start@^1.169.2` and `@tanstack/react-router@^1.170.44`. Install the React adapter. It brings in the OIDC core as a dependency.
10
12
 
11
13
  ```sh
12
- npm install @lpshanley/oidc-start-react@next @lpshanley/oidc-start-core@next
14
+ npm install @lpshanley/oidc-start-react
13
15
  ```
14
16
 
15
17
  Register a confidential web client with your OIDC provider. If your app runs at `http://localhost:5173`, register these exact URLs. Use your public HTTPS origin in production.
@@ -30,7 +32,7 @@ OIDC_CLIENT_SECRET=your-client-secret
30
32
  SESSION_SECRET=
31
33
  ```
32
34
 
33
- For local development, copy the example’s `auth.server.ts` into `src/auth.server.ts`. It exports an `auth` instance configured with `callbackPath: '/callback'` and `postLogoutPath: '/'`. The example admits any authenticated user and keeps revocations in memory. For deployment, set `allowSession` to your access policy and use a durable revocation store shared by all instances. [Copy auth.server.ts](https://github.com/lpshanley/oidc-start/blob/main/examples/tanstack-start/src/auth.server.ts) · [Core configuration and storage](https://www.npmjs.com/package/@lpshanley/oidc-start-core)
35
+ Import `createOidcCore` and the `SessionRevocations` type from `@lpshanley/oidc-start-react/server` in your server module. For local development, copy the example’s `auth.server.ts` into `src/auth.server.ts`. It exports an `auth` instance configured with `callbackPath: '/callback'` and `postLogoutPath: '/'`. The example admits any authenticated user and keeps revocations in memory. For deployment, set `allowSession` to your access policy and use a durable revocation store shared by all instances. [Copy auth.server.ts](https://github.com/lpshanley/oidc-start/blob/main/examples/tanstack-start/src/auth.server.ts) · [Core configuration and storage](https://www.npmjs.com/package/@lpshanley/oidc-start-core)
34
36
 
35
37
  ## 2. Register the request middleware
36
38
 
@@ -67,7 +69,7 @@ export const Route = createFileRoute('/callback')({
67
69
  In `src/routes/index.tsx`, call `getAuth()` from the loader. It returns `{ user }`, with `user: null` for a signed-out visitor. Bind `signOut` with `useServerFn` so TanStack follows the redirect to the provider when the user clicks the button.
68
70
 
69
71
  ```tsx
70
- import { displayName } from '@lpshanley/oidc-start-core/models'
72
+ import { displayName } from '@lpshanley/oidc-start-react'
71
73
  import { getAuth, getSignInUrl, signOut } from '@lpshanley/oidc-start-react/functions'
72
74
  import { createFileRoute } from '@tanstack/react-router'
73
75
  import { useServerFn } from '@tanstack/react-start'
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "@lpshanley/oidc-start-core/models";
1
2
  export type { OidcCallContext, OidcErrorEvent, OidcMiddlewareOptions, } from "@lpshanley/oidc-start-core/config";
2
3
  export { type OidcMiddlewareSetup, oidcMiddleware } from "./middleware.js";
3
4
  export { type CallbackRouteOptions, handleBackchannelLogoutRoute, handleCallbackRoute, handleSignInRoute, handleSignOutRoute, } from "./routes.js";
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
+ export * from "@lpshanley/oidc-start-core/models";
1
2
  export { oidcMiddleware } from "./middleware.js";
2
3
  export { handleBackchannelLogoutRoute, handleCallbackRoute, handleSignInRoute, handleSignOutRoute, } from "./routes.js";
package/dist/server.d.ts CHANGED
@@ -1 +1,2 @@
1
+ export * from "@lpshanley/oidc-start-core";
1
2
  export { getOidcContext, type OidcContext } from "./context.js";
package/dist/server.js CHANGED
@@ -1 +1,2 @@
1
+ export * from "@lpshanley/oidc-start-core";
1
2
  export { getOidcContext } from "./context.js";
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@lpshanley/oidc-start-react",
3
- "version": "0.1.0-next.1",
3
+ "version": "0.2.0",
4
+ "license": "MIT",
4
5
  "repository": {
5
6
  "type": "git",
6
7
  "url": "git+https://github.com/lpshanley/oidc-start.git",
@@ -35,7 +36,7 @@
35
36
  "node": ">=22.12.0"
36
37
  },
37
38
  "dependencies": {
38
- "@lpshanley/oidc-start-core": "0.1.0-next.1",
39
+ "@lpshanley/oidc-start-core": "0.2.0",
39
40
  "zod": "4.6.7"
40
41
  },
41
42
  "devDependencies": {