Replace Logger with getLogger and update next version
This commit replaces the use of Logger with getLogger in various parts of the code to handle logging. The Logger has been replaced with getLogger, which assists in getting logs in an asynchronous manner. In addition to this, it updates the next version in pnpm-lock.yaml from next@14.2.0-canary.61 to next@14.2.0-canary.62 and various other dependencies. Also made minor annotations and comments to the function 'isBrowser' and 'formatCurrency' in the 'utils.ts' file.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { redirect } from 'next/navigation';
|
||||
import type { NextRequest } from 'next/server';
|
||||
|
||||
import { Logger } from '@kit/shared/logger';
|
||||
import { getLogger } from '@kit/shared/logger';
|
||||
import { getSupabaseRouteHandlerClient } from '@kit/supabase/route-handler-client';
|
||||
|
||||
import pathsConfig from '~/config/paths.config';
|
||||
@@ -38,9 +38,12 @@ export async function GET(request: NextRequest) {
|
||||
return onError({ error: error.message });
|
||||
}
|
||||
} catch (error) {
|
||||
Logger.error(
|
||||
const logger = await getLogger();
|
||||
|
||||
logger.error(
|
||||
{
|
||||
error,
|
||||
name: `auth.callback`,
|
||||
},
|
||||
`An error occurred while exchanging code for session`,
|
||||
);
|
||||
@@ -58,12 +61,14 @@ export async function GET(request: NextRequest) {
|
||||
return redirect(nextUrl);
|
||||
}
|
||||
|
||||
function onError({ error }: { error: string }) {
|
||||
async function onError({ error }: { error: string }) {
|
||||
const errorMessage = getAuthErrorMessage(error);
|
||||
const logger = await getLogger();
|
||||
|
||||
Logger.error(
|
||||
logger.error(
|
||||
{
|
||||
error,
|
||||
name: `auth.callback`,
|
||||
},
|
||||
`An error occurred while signing user in`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user