@appocus/auth-react-router 0.2.0 → 0.3.2

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
@@ -1,6 +1,6 @@
1
1
  # @appocus/auth-react-router
2
2
 
3
- OAuth login plumbing for Appocus apps built on React Router 7 + `@zauru-sdk/webapp-services`.
3
+ OAuth login plumbing for Appocus apps built on React Router 7 + `@zauru-sdk/services`.
4
4
 
5
5
  ## What's inside
6
6
 
@@ -18,7 +18,7 @@ OAuth login plumbing for Appocus apps built on React Router 7 + `@zauru-sdk/weba
18
18
  pnpm add @appocus/auth-react-router
19
19
  ```
20
20
 
21
- Peer deps: `react`, `react-router`, `sonner`, `@zauru-sdk/webapp-services`, `@zauru-sdk/webapp-config`.
21
+ Peer deps: `react`, `react-router`, `sonner`, `@zauru-sdk/services`, `@zauru-sdk/config`.
22
22
 
23
23
  ## Configure once
24
24
 
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Browser-safe entry point for @appocus/auth-react-router.
3
+ *
4
+ * Does NOT include middleware.ts or the route factories that depend on
5
+ * @zauru-sdk/services (which pulls in @remix-run/node at runtime).
6
+ * Those server-only exports remain accessible via the default entry point in
7
+ * SSR / Node.js environments.
8
+ */
9
+ export * from "./authenticated-fetch.js";
10
+ export * from "./oauth-authorize-url.js";
11
+ export * from "./reauth-constants.js";
12
+ export * from "./reauth-popup.client.js";
13
+ export * from "./auth-shell-layout.js";
14
+ export * from "./redirect-if-authenticated.js";
15
+ export * from "./route-types.js";
16
+ export * from "./runtime-config.js";
17
+ export * from "./routes/callback.js";
18
+ export * from "./routes/login-popup.js";
19
+ export * from "./routes/reauth-popup-done.js";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Browser-safe entry point for @appocus/auth-react-router.
3
+ *
4
+ * Does NOT include middleware.ts or the route factories that depend on
5
+ * @zauru-sdk/services (which pulls in @remix-run/node at runtime).
6
+ * Those server-only exports remain accessible via the default entry point in
7
+ * SSR / Node.js environments.
8
+ */
9
+ export * from "./authenticated-fetch.js";
10
+ export * from "./oauth-authorize-url.js";
11
+ export * from "./reauth-constants.js";
12
+ export * from "./reauth-popup.client.js";
13
+ export * from "./auth-shell-layout.js";
14
+ export * from "./redirect-if-authenticated.js";
15
+ export * from "./route-types.js";
16
+ export * from "./runtime-config.js";
17
+ export * from "./routes/callback.js";
18
+ export * from "./routes/login-popup.js";
19
+ export * from "./routes/reauth-popup-done.js";
@@ -1,5 +1,5 @@
1
1
  import { redirect } from "react-router";
2
- import { getSession, getRefreshSession } from "@zauru-sdk/webapp-services";
2
+ import { getSession, getRefreshSession } from "@zauru-sdk/services";
3
3
  /**
4
4
  * Throws a redirect to `/login` if the request has no OAuth session cookie.
5
5
  * Attach as a route middleware on authenticated routes.
@@ -1,4 +1,4 @@
1
- import { config } from "@zauru-sdk/webapp-config";
1
+ import { config } from "@zauru-sdk/config";
2
2
  /**
3
3
  * Build the Zauru OAuth `dialog/authorize` URL using the host's `request.url` to
4
4
  * derive the `redirect_uri`. Pass `options.state` to mark this authorization as
@@ -3,8 +3,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useEffect, useState } from "react";
4
4
  import { redirect, useNavigate, useSearchParams, useSubmit, } from "react-router";
5
5
  import { toast } from "sonner";
6
- import { commitSession, getSession, nativeLogin, } from "@zauru-sdk/webapp-services";
7
- import { config } from "@zauru-sdk/webapp-config";
6
+ import { commitSession, getSession, nativeLogin, } from "@zauru-sdk/services";
7
+ import { config } from "@zauru-sdk/config";
8
8
  import { loginMiddleware } from "../middleware.js";
9
9
  import { AuthShellLayout } from "../auth-shell-layout.js";
10
10
  import { getAuthRuntime } from "../runtime-config.js";
@@ -2,8 +2,8 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useEffect } from "react";
4
4
  import { redirect, useSubmit } from "react-router";
5
- import { getSession, destroySession } from "@zauru-sdk/webapp-services";
6
- import { config } from "@zauru-sdk/webapp-config";
5
+ import { getSession, destroySession } from "@zauru-sdk/services";
6
+ import { config } from "@zauru-sdk/config";
7
7
  import { AuthShellLayout } from "../auth-shell-layout.js";
8
8
  /** Module-scope flag to avoid double-submission under React Strict Mode. */
9
9
  let logoutAutoSubmitStarted = false;
@@ -1,7 +1,7 @@
1
1
  import type { LoginFormComponent, RouteModule } from "../route-types.js";
2
2
  /**
3
3
  * Minimal session contract this route depends on. Re-typed locally so we don't
4
- * pull `@zauru-sdk/webapp-services` types into the consumer surface.
4
+ * pull `@zauru-sdk/services` types into the consumer surface.
5
5
  */
6
6
  type ZauruSession = {
7
7
  get: (key: string) => unknown;
package/package.json CHANGED
@@ -1,11 +1,18 @@
1
1
  {
2
2
  "name": "@appocus/auth-react-router",
3
- "version": "0.2.0",
3
+ "version": "0.3.2",
4
4
  "description": "OAuth login flow building blocks for Appocus React Router apps: middlewares, OAuth URL builder, authenticated fetch with reauth popup, and route factories for /login, /logout, /login-popup, /callback and the reauth-popup-done page.",
5
5
  "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "type": "module",
9
+ "exports": {
10
+ ".": {
11
+ "browser": "./dist/esm/client.js",
12
+ "import": "./dist/esm/index.js",
13
+ "default": "./dist/esm/index.js"
14
+ }
15
+ },
9
16
  "publishConfig": {
10
17
  "access": "public",
11
18
  "registry": "https://registry.npmjs.org/"
@@ -23,20 +30,20 @@
23
30
  },
24
31
  "license": "MIT",
25
32
  "peerDependencies": {
26
- "@zauru-sdk/webapp-config": "*",
27
- "@zauru-sdk/webapp-services": "*",
33
+ "@zauru-sdk/config": "*",
34
+ "@zauru-sdk/services": "*",
28
35
  "react": "^18.2.0 || ^19.0.0",
29
36
  "react-router": "^7.0.0",
30
37
  "sonner": "^1.0.0 || ^2.0.0"
31
38
  },
32
39
  "devDependencies": {
33
40
  "@types/react": "^19.0.0",
34
- "@zauru-sdk/webapp-config": "^5.0.3",
35
- "@zauru-sdk/webapp-services": "^5.0.3",
41
+ "@zauru-sdk/config": "^6.0.0",
42
+ "@zauru-sdk/services": "^6.0.0",
36
43
  "react": "^19.0.0",
37
44
  "react-router": "^7.10.1",
38
45
  "sonner": "^2.0.7",
39
46
  "typescript": "^5.1.6"
40
47
  },
41
- "gitHead": "51b05d54842786418df070ccbcc9b190d29c88bb"
48
+ "gitHead": "dabafd40914d3d0dd6fcd39f3490c074659a4309"
42
49
  }