@pathmx/auth 0.5.0 → 0.5.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 +37 -36
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # `@pathmx/auth`
2
2
 
3
- Optional PathMX authentication with development Actor switching,
4
- production magic links, isolated SQLite state, React App View Components, and
5
- plugin-contributed administrator commands.
3
+ Optional authentication and account UI for PathMX applications. Development
4
+ mode provides local Actor switching; production supports provider-based
5
+ credentials such as magic links.
6
6
 
7
7
  ## Install
8
8
 
@@ -11,49 +11,50 @@ bun run pmx plugins add auth
11
11
  ```
12
12
 
13
13
  ```ts
14
- // plugins/auth/index.plugin.ts
14
+ // plugins/auth.plugin.ts
15
15
  export { default } from "@pathmx/auth"
16
16
  ```
17
17
 
18
- Run `pmx auth setup`, copy `.env.example` to `.env`, and set:
18
+ Auth is intentionally separate from [`@pathmx/paths`](https://www.npmjs.com/package/@pathmx/paths)
19
+ because every deployment must choose its own credential provider.
19
20
 
20
- - `PATHMX_AUTH_MODE=magic-link`
21
- - `PATHMX_AUTH_ORIGIN` to the exact public origin
22
- - `PATHMX_AUTH_SECRET` to at least 32 characters
23
- - `PATHMX_AUTH_EMAIL_FROM` and `RESEND_API_KEY`
21
+ ## Development
24
22
 
25
- The setup command installs the exported `AuthSetupPattern`. Different existing
26
- files are preserved, and the resulting Sources and configuration are ordinary
27
- user-owned project files with no runtime Pattern dependency.
23
+ Start the project with `pmx dev`. The development credential host lets you
24
+ switch among repository Actors locally without configuring a production
25
+ provider.
28
26
 
29
- Only emails authored on User Sources may receive a link. GET requests to the
30
- confirmation page are inert; the token stays in the URL fragment and the React
31
- client submits it once by same-origin POST.
32
-
33
- Additional providers implement `AuthProviderFactory` and are passed with
34
- `AuthPlugin({ providers: [...] })`. Factories receive the isolated auth
35
- database and structured auth logger; provider resolution and `/api/auth/*`
36
- handling compose in declaration order.
37
-
38
- `pmx dev` binds to `127.0.0.1` because its development Actor switcher is local
39
- administrator tooling, not authentication for a shared server. Use a production
40
- provider when exposing PathMX through a tunnel, proxy, container port, or LAN.
41
-
42
- ## UI
27
+ Available UI components are:
43
28
 
44
29
  - `<x-auth-sign-in />`
45
30
  - `<x-auth-confirm />`
46
31
  - `<x-auth-session />`
47
32
 
48
- The components render useful HTML before JavaScript, inherit the PathMX theme,
49
- and can be restyled with ordinary repository CSS. Override `--auth-accent`,
50
- `--auth-border`, or `--auth-surface` on `.pmx-auth`; authored attributes such as
51
- `email-label` and `submit-label` customize sign-in copy. Advanced provider UIs
52
- can replace the component set through `AuthPlugin({ components })`.
33
+ ## Magic-link setup
34
+
35
+ Generate the stock sign-in pages and environment template:
36
+
37
+ ```sh
38
+ bun run pmx auth setup
39
+ ```
53
40
 
54
- ## Commands
41
+ Copy the generated `.env.example` values into your local `.env` and configure
42
+ them for the deployment:
43
+
44
+ ```dotenv
45
+ PATHMX_AUTH_MODE=magic-link
46
+ PATHMX_AUTH_ORIGIN=https://example.com
47
+ PATHMX_AUTH_SECRET=replace-with-at-least-32-characters
48
+ PATHMX_AUTH_EMAIL_FROM=PathMX <auth@example.com>
49
+ RESEND_API_KEY=replace-with-your-key
50
+ ```
51
+
52
+ Only emails declared on User Sources can receive a sign-in link. Before
53
+ deploying, verify the configuration with:
54
+
55
+ ```sh
56
+ bun run pmx auth doctor
57
+ ```
55
58
 
56
- - `pmx auth setup`
57
- - `pmx auth doctor`
58
- - `pmx auth users list`
59
- - `pmx auth sessions revoke-all`
59
+ Custom integrations can import `AuthPlugin`, `magicLinkProvider`, and provider
60
+ types from `@pathmx/auth` or `@pathmx/auth/providers`.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pathmx/auth",
3
3
  "description": "Authentication and account UI for PathMX applications.",
4
- "version": "0.5.0",
4
+ "version": "0.5.1",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "repository": {
7
7
  "type": "git",
@@ -29,7 +29,7 @@
29
29
  "react-dom": ">=19.0.0"
30
30
  },
31
31
  "dependencies": {
32
- "@pathmx/react": "0.5.0",
32
+ "@pathmx/react": "0.5.1",
33
33
  "better-auth": "1.6.29"
34
34
  }
35
35
  }