Skip to content

Commit 9a44bba

Browse files
committed
:chore: Show console.warn only dev env (#2446)
1 parent 5713b75 commit 9a44bba

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/lib/utils/authorship.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ const createAuthFormWithFallback = async () => {
3434

3535
return result;
3636
} catch (error) {
37-
console.warn(`Failed to ${strategy.name}`);
37+
if (import.meta.env.DEV) {
38+
console.warn(`Failed to ${strategy.name}`);
3839

39-
if (error instanceof Error) {
40-
console.warn('Error:', error.message);
40+
if (error instanceof Error) {
41+
console.warn('Error:', error.message);
42+
}
4143
}
4244
}
4345
}
@@ -100,10 +102,12 @@ export const validateAuthFormWithFallback = async (request: Request) => {
100102

101103
return result.form;
102104
} catch (error) {
103-
console.warn(`Failed to ${strategy.name}`);
105+
if (import.meta.env.DEV) {
106+
console.warn(`Failed to ${strategy.name}`);
104107

105-
if (error instanceof Error) {
106-
console.warn('Error:', error.message);
108+
if (error instanceof Error) {
109+
console.warn('Error:', error.message);
110+
}
107111
}
108112
}
109113
}

0 commit comments

Comments
 (0)