Spaces:
Runtime error
Runtime error
| import { z } from "zod"; | |
| import { Context, Route } from "../hapticLinkServer"; | |
| export interface TestConnectionPayload { } | |
| export const TestConnnectionSchema = z.object({}) | |
| export function TestConnectionHandler(ctx: Context<TestConnectionPayload>) { | |
| if (ctx.user) { | |
| return ctx.ws.send(JSON.stringify({ | |
| "message": "test_connection_response", | |
| "authenticated": true, | |
| "username": ctx.user.username | |
| })) | |
| } | |
| return ctx.ws.send(JSON.stringify({ | |
| "message": "test_connection_response", | |
| "authenticated": false, | |
| })) | |
| } | |