feat: oauth-based login (#7)

This commit is contained in:
Roberto Vidal
2024-07-29 19:31:45 +01:00
committed by GitHub
parent b8a197ed16
commit 7ebc805ffa
17 changed files with 523 additions and 102 deletions

View File

@@ -1,12 +1,17 @@
import { type ActionFunctionArgs } from '@remix-run/cloudflare';
import { StreamingTextResponse, parseStreamPart } from 'ai';
import { streamText } from '~/lib/.server/llm/stream-text';
import { handleWithAuth } from '~/lib/.server/login';
import { stripIndents } from '~/utils/stripIndent';
const encoder = new TextEncoder();
const decoder = new TextDecoder();
export async function action({ context, request }: ActionFunctionArgs) {
export async function action(args: ActionFunctionArgs) {
return handleWithAuth(args, enhancerAction);
}
async function enhancerAction({ context, request }: ActionFunctionArgs) {
const { message } = await request.json<{ message: string }>();
try {