@bigio/better-auth-electron 1.0.1 → 1.0.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,3 +1,41 @@
1
+ ## I'm currently studying the official implementation; the documentation is still rough but will be improved soon. I'm eager and looking forward to exchanging ideas with everyone.
2
+
3
+ Based on my study of the official implementation code, I have decided on the following to-do list:
4
+ **1. Architecture: The "Silent Handoff" (Stateless & Secure)**
5
+
6
+ * [ ] **Server-Side Cookie Interception**: Modify `electron-server-plugin` to intercept the OAuth callback response.
7
+ * *Action*: Strip the `Set-Cookie` header (specifically the session token) from the response to prevent overwriting the user's browser session.
8
+ * *Goal*: Achieve strict physical isolation between Web Session and Electron Session.
9
+
10
+
11
+ * [ ] **Stateless OAuth Flow**: Ensure the OAuth flow relies solely on the encrypted `Ticket` mechanism, making the browser a purely stateless transport layer for Electron authentication.
12
+
13
+ **2. Security & Hardening**
14
+
15
+ * [ ] **Secure Persistence**: Implement `safeStorage` (DPAPI/Keychain) for encrypting the persisted PKCE Verifier on disk.
16
+ * *Reason*: Prevent plaintext credentials from resting on the file system.
17
+
18
+
19
+ * [ ] **User-Agent Scrubbing**: Global removal of "Electron" tokens from the `User-Agent` string at the `app.on('ready')` stage.
20
+ * *Reason*: Bypass WAF/Anti-Bot protections that block Electron-based requests during the ticket exchange phase.
21
+
22
+
23
+ * [ ] **Automated CSP Injection**: Implement `onHeadersReceived` interceptor in the Main Process.
24
+ * *Action*: Automatically append the backend API URL to the `connect-src` directive.
25
+ * *Goal*: Provide a "Zero-Config" experience by preventing CSP violations without requiring users to manually edit `index.html`.
26
+
27
+
28
+
29
+ **3. Developer Experience (DX) & API**
30
+
31
+ * [ ] **Enhanced Renderer API**: Refactor `getActions` to introduce a dedicated `authClient.bigio` namespace.
32
+ * *Feature*: Implement `authClient.bigio.signIn({ provider: 'github' })` wrapper.
33
+ * *Implementation*: Utilize `window.open` (intercepted by Main) or IPC to trigger the flow, keeping the API consistent with the official web client style.
34
+
35
+
36
+ * [ ] **Smart Web Handoff UI (Optional/Next)**: Update the web-side confirmation page to detect and display the currently logged-in web user, offering a "Continue as [User]" button for a seamless transition.
37
+
38
+
1
39
  # @bigio/better-auth-electron
2
40
 
3
41
  > **Work In Progress:** This library is actively being developed. Detailed documentation and architecture diagrams are coming soon.
@@ -14,7 +52,7 @@ Designed for production-grade applications, this library provides a secure, "bat
14
52
  - ** Secure PKCE Flow:**
15
53
  Implements the standard **Proof Key for Code Exchange** protocol out-of-the-box. Ensures enterprise-grade security for your OAuth exchanges without exposing secrets.
16
54
 
17
- - ** Preact SSR Ready:**
55
+ - ** Preact SSR Coming soon:**
18
56
  Includes a dedicated, lightweight Preact entry point optimized for Server-Side Rendering (SSR) in login windows.
19
57
  _(React 19 supported. Vue/Svelte support coming soon!)_
20
58