mirror of
https://github.com/kennethnym/aris.git
synced 2026-06-18 13:31:20 +01:00
feat: add agent websocket endpoint
This commit is contained in:
@@ -53,16 +53,6 @@ export function createRequireSession(auth: Auth): AuthSessionMiddleware {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function to get session from headers. Useful for WebSocket upgrade validation.
|
||||
*/
|
||||
export function createGetSessionFromHeaders(auth: Auth) {
|
||||
return async (headers: Headers): Promise<{ user: AuthUser; session: AuthSession } | null> => {
|
||||
const session = await auth.api.getSession({ headers })
|
||||
return session
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dev/test middleware that injects a fake user and session.
|
||||
* Pass userId to simulate an authenticated request, or omit to get 401.
|
||||
|
||||
Reference in New Issue
Block a user