Spaces:
Sleeping
Sleeping
Fix last sessionKey references in validation logic
Browse files
app/components/SessionManagerWindow.tsx
CHANGED
|
@@ -57,29 +57,29 @@ export function SessionManagerWindow({ onClose, sessionId }: SessionManagerWindo
|
|
| 57 |
|
| 58 |
// Session is automatically created - no manual creation needed!
|
| 59 |
|
| 60 |
-
// Validate session
|
| 61 |
useEffect(() => {
|
| 62 |
-
if (
|
| 63 |
-
|
| 64 |
}
|
| 65 |
// eslint-disable-next-line react-hooks/exhaustive-deps
|
| 66 |
}, [])
|
| 67 |
|
| 68 |
-
// Validate session
|
| 69 |
-
const
|
| 70 |
setValidating(true)
|
| 71 |
setError(null)
|
| 72 |
try {
|
| 73 |
const response = await fetch('/api/sessions/verify', {
|
| 74 |
method: 'POST',
|
| 75 |
headers: { 'Content-Type': 'application/json' },
|
| 76 |
-
body: JSON.stringify({
|
| 77 |
})
|
| 78 |
const data = await response.json()
|
| 79 |
|
| 80 |
if (data.success && data.valid) {
|
| 81 |
setSessionValid(true)
|
| 82 |
-
setSuccess('✅ Session is VALID! You can safely copy and use this
|
| 83 |
setTimeout(() => setSuccess(null), 5000)
|
| 84 |
} else {
|
| 85 |
setSessionValid(false)
|
|
|
|
| 57 |
|
| 58 |
// Session is automatically created - no manual creation needed!
|
| 59 |
|
| 60 |
+
// Validate session on component mount
|
| 61 |
useEffect(() => {
|
| 62 |
+
if (sessionId) {
|
| 63 |
+
validateSession()
|
| 64 |
}
|
| 65 |
// eslint-disable-next-line react-hooks/exhaustive-deps
|
| 66 |
}, [])
|
| 67 |
|
| 68 |
+
// Validate session
|
| 69 |
+
const validateSession = async () => {
|
| 70 |
setValidating(true)
|
| 71 |
setError(null)
|
| 72 |
try {
|
| 73 |
const response = await fetch('/api/sessions/verify', {
|
| 74 |
method: 'POST',
|
| 75 |
headers: { 'Content-Type': 'application/json' },
|
| 76 |
+
body: JSON.stringify({ sessionId })
|
| 77 |
})
|
| 78 |
const data = await response.json()
|
| 79 |
|
| 80 |
if (data.success && data.valid) {
|
| 81 |
setSessionValid(true)
|
| 82 |
+
setSuccess('✅ Session is VALID! You can safely copy and use this Session ID with Claude Desktop.')
|
| 83 |
setTimeout(() => setSuccess(null), 5000)
|
| 84 |
} else {
|
| 85 |
setSessionValid(false)
|