From 3a90682768f95d3d5f8da76676d6ad80e8816635 Mon Sep 17 00:00:00 2001 From: Olaf Rosendahl Date: Fri, 26 Apr 2024 14:10:32 +0200 Subject: [PATCH] chore: logging --- web/app/routes/auth.github._index.tsx | 11 ++++++++--- web/app/routes/auth.github.callback.tsx | 6 ++++-- web/vite.config.ts | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/web/app/routes/auth.github._index.tsx b/web/app/routes/auth.github._index.tsx index c215794..d15b18d 100644 --- a/web/app/routes/auth.github._index.tsx +++ b/web/app/routes/auth.github._index.tsx @@ -2,10 +2,15 @@ import type { ActionFunctionArgs, LoaderFunctionArgs } from '@vercel/remix'; import { authenticator } from '~/auth.server'; import { redirect } from '~/utils.server'; -export const loader = async ({ response }: LoaderFunctionArgs) => redirect(response, '/'); +export const loader = async ({ response }: LoaderFunctionArgs) => { + console.log('GitHub index loader', response); + return redirect(response, '/'); +}; -export const action = async ({ request }: ActionFunctionArgs) => - authenticator.authenticate('github', request, { +export const action = async ({ request, response }: ActionFunctionArgs) => { + console.log('GitHub index action', response); + return authenticator.authenticate('github', request, { failureRedirect: '/', successRedirect: '/dashboard', }); +}; diff --git a/web/app/routes/auth.github.callback.tsx b/web/app/routes/auth.github.callback.tsx index 2c0caf1..bcf9d3c 100644 --- a/web/app/routes/auth.github.callback.tsx +++ b/web/app/routes/auth.github.callback.tsx @@ -1,8 +1,10 @@ import type { LoaderFunctionArgs } from '@vercel/remix'; import { authenticator } from '~/auth.server'; -export const loader = async ({ request }: LoaderFunctionArgs) => - authenticator.authenticate('github', request, { +export const loader = async ({ request, response }: LoaderFunctionArgs) => { + console.log('GitHub callback loader', response); + return authenticator.authenticate('github', request, { successRedirect: '/dashboard', failureRedirect: '/', }); +}; diff --git a/web/vite.config.ts b/web/vite.config.ts index e2dc9c8..afae101 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -5,7 +5,7 @@ import { defineConfig } from 'vite'; import tsconfigPaths from 'vite-tsconfig-paths'; import tailwindcss from '@tailwindcss/vite'; -installGlobals(); +installGlobals({ nativeFetch: true }); export default defineConfig({ server: {