Skip to content

Commit

Permalink
chore: logging
Browse files Browse the repository at this point in the history
  • Loading branch information
olros committed Apr 26, 2024
1 parent 8c8c96e commit 3a90682
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
11 changes: 8 additions & 3 deletions web/app/routes/auth.github._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
};
6 changes: 4 additions & 2 deletions web/app/routes/auth.github.callback.tsx
Original file line number Diff line number Diff line change
@@ -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: '/',
});
};
2 changes: 1 addition & 1 deletion web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 3a90682

Please sign in to comment.