diff --git a/bin/ailog-linux-x86_64.tar.gz b/bin/ailog-linux-x86_64.tar.gz index dd0b295..f6baddb 100644 Binary files a/bin/ailog-linux-x86_64.tar.gz and b/bin/ailog-linux-x86_64.tar.gz differ diff --git a/oauth/src/App.jsx b/oauth/src/App.jsx index 9ab8d20..5e49c65 100644 --- a/oauth/src/App.jsx +++ b/oauth/src/App.jsx @@ -133,6 +133,7 @@ export default function App() { { refreshAdminData?.() refreshUserData?.() diff --git a/oauth/src/components/CommentForm.jsx b/oauth/src/components/CommentForm.jsx index 1f7c615..c7d21eb 100644 --- a/oauth/src/components/CommentForm.jsx +++ b/oauth/src/components/CommentForm.jsx @@ -2,21 +2,22 @@ import React, { useState } from 'react' import { atproto, collections } from '../api/atproto.js' import { env } from '../config/env.js' -export default function CommentForm({ user, agent, onCommentPosted }) { +export default function CommentForm({ user, agent, onCommentPosted, pageContext }) { const [text, setText] = useState('') - const [url, setUrl] = useState('') const [loading, setLoading] = useState(false) const [error, setError] = useState(null) + + // Get current URL automatically + const currentUrl = pageContext?.url || window.location.href const handleSubmit = async (e) => { e.preventDefault() - if (!text.trim() || !url.trim()) return + if (!text.trim()) return setLoading(true) setError(null) try { - const currentUrl = url.trim() const timestamp = new Date().toISOString() // Create ai.syui.log record structure (new unified format) @@ -55,7 +56,6 @@ export default function CommentForm({ user, agent, onCommentPosted }) { // Clear form setText('') - setUrl('') // Notify parent component if (onCommentPosted) { @@ -86,18 +86,8 @@ export default function CommentForm({ user, agent, onCommentPosted }) {

コメントを投稿

-
- - setUrl(e.target.value)} - placeholder="https://syui.ai/posts/example" - required - disabled={loading} - className="form-input" - /> +
+ ページ: {currentUrl}
diff --git a/oauth/src/components/OAuthCallback.jsx b/oauth/src/components/OAuthCallback.jsx index f61b444..ffb5655 100644 --- a/oauth/src/components/OAuthCallback.jsx +++ b/oauth/src/components/OAuthCallback.jsx @@ -20,11 +20,15 @@ export default function OAuthCallback({ onAuthSuccess }) { } if (code) { - setStatus('認証成功!メインページに戻ります...') + setStatus('認証成功!元のページに戻ります...') - // 少し待ってからメインページにリダイレクト + // 認証前のページを復元するか、ルートページに戻る + const returnUrl = sessionStorage.getItem('oauth_return_url') || '/' + sessionStorage.removeItem('oauth_return_url') + + // 少し待ってから元のページにリダイレクト setTimeout(() => { - window.location.href = '/' + window.location.href = returnUrl }, 1500) } else { setStatus('認証情報が見つかりません') diff --git a/oauth/src/services/oauth.js b/oauth/src/services/oauth.js index 2cff4ac..dadd6d6 100644 --- a/oauth/src/services/oauth.js +++ b/oauth/src/services/oauth.js @@ -97,6 +97,13 @@ export class OAuthService { async login(handle) { await this.initialize() + // Save current URL for return after OAuth + const currentUrl = window.location.href + // Only save if not already on oauth callback page + if (!currentUrl.includes('/oauth/callback')) { + sessionStorage.setItem('oauth_return_url', currentUrl) + } + const client = isSyuIsHandle(handle) ? this.clients.syu : this.clients.bsky const authUrl = await client.authorize(handle, { scope: 'atproto transition:generic'