Skip to content

Commit

Permalink
fix: clean console
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayllyz committed Apr 15, 2024
1 parent 831de77 commit 768d0e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
10 changes: 2 additions & 8 deletions apps/api/src/handlers/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ auth.openapi(loginUser, async (c) => {

const { data, error } = await supabase.auth.signInWithPassword({ email, password });

if (error) {
console.error('Error while signing in', error);
throw new HTTPException(401, { message: error.message });
}
if (error) throw new HTTPException(401, { message: error.message });

setCookie(c, 'access_token', data?.session.access_token, {
maxAge: 31536000, // 1 year
Expand Down Expand Up @@ -88,10 +85,7 @@ auth.openapi(refreshTokens, async (c) => {
refresh_token,
});

if (error) {
console.error('Error while refreshing token', error);
throw new HTTPException(403, { message: error.message });
}
if (error) throw new HTTPException(403, { message: error.message });

if (data?.session) {
setCookie(c, 'refresh_token', data.session.refresh_token, {
Expand Down
1 change: 0 additions & 1 deletion apps/api/src/libs/supabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export const supabase = createClient<Database>(process.env.SUPABASE_URL || '', p

if (!supabase) {
console.error('Supabase client not created');
console.log(process.env);
exit(1);
}

Expand Down

0 comments on commit 768d0e1

Please sign in to comment.