updating iframe auth handling
This commit is contained in:
+31
-2
@@ -129,6 +129,35 @@
|
||||
<input type="text" id="token" class="manual-token" placeholder="Paste PB Token here...">
|
||||
<button class="send-manual" onclick="sendAuthFromInput()">Send Manual Token</button>
|
||||
</div>
|
||||
|
||||
<div id="docs-section" style="margin-top: 30px; border-top: 1px solid #eee; padding-top: 20px;">
|
||||
<details>
|
||||
<summary style="cursor: pointer; font-weight: bold; color: #007bff;">Developer Integration Guide
|
||||
</summary>
|
||||
<div style="font-size: 14px; line-height: 1.6; margin-top: 15px;">
|
||||
<p><strong>1. Available Routes:</strong></p>
|
||||
<ul>
|
||||
<li><code>/embed/notes</code>: Renders the full notepad/editor.</li>
|
||||
<li><code>/embed/quick-add</code>: Renders a standalone task creation form.</li>
|
||||
</ul>
|
||||
|
||||
<p><strong>2. Authentication Protocol:</strong></p>
|
||||
<p>The parent application must send a <code>postMessage</code> to the iframe immediately after the
|
||||
iframe loads (or whenever auth state changes).</p>
|
||||
<pre
|
||||
style="background: #f8f9fa; padding: 15px; border-radius: 4px; border: 1px solid #e9ecef; overflow-x: auto;">
|
||||
iframe.contentWindow.postMessage({
|
||||
type: "TASGRID_AUTH",
|
||||
token: "YOUR_POCKETBASE_TOKEN",
|
||||
user: { /* optional PB user record */ }
|
||||
}, "*");</pre>
|
||||
|
||||
<p><strong>3. Responsiveness:</strong></p>
|
||||
<p>Both routes are designed to be fluid. Ensure your iframe container has defined dimensions; the
|
||||
content will expand to fill it.</p>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
@@ -138,7 +167,7 @@
|
||||
<span>Notes Embed</span>
|
||||
<code style="font-size: 10px;">/embed/notes</code>
|
||||
</div>
|
||||
<iframe id="notes-iframe" src="http://localhost:5173/embed/notes"></iframe>
|
||||
<iframe id="notes-iframe" src="http://localhost:4000/embed/notes"></iframe>
|
||||
</div>
|
||||
|
||||
<div class="iframe-container">
|
||||
@@ -147,7 +176,7 @@
|
||||
<span>Quick Add Embed</span>
|
||||
<code style="font-size: 10px;">/embed/quick-add</code>
|
||||
</div>
|
||||
<iframe id="quick-add-iframe" src="http://localhost:5173/embed/quick-add"></iframe>
|
||||
<iframe id="quick-add-iframe" src="http://localhost:4000/embed/quick-add"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user