Skip to content

Commit

Permalink
remove custom plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
craigkai committed Oct 15, 2024
1 parent 5854ea3 commit 130611d
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
plugins: [
sveltekit(),
myErrorFilterPlugin(),
VitePWA({
registerType: 'autoUpdate',
devOptions: {
Expand All @@ -20,31 +19,3 @@ export default defineConfig({
sourcemap: true
}
});

export function myErrorFilterPlugin(): Plugin {
return {
name: 'error-filter-plugin',
configureServer(server) {
const filterMessage =
'Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and many not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server.';

// Intercept console.warn
const originalWarn = console.warn;
console.warn = (...args: any[]) => {
if (args[0] && typeof args[0] === 'string' && args[0].includes(filterMessage)) {
return;
}
originalWarn(...args);
};

// Intercept console.log
const originalLog = console.log;
console.log = (...args: any[]) => {
if (args[0] && typeof args[0] === 'string' && args[0].includes(filterMessage)) {
return;
}
originalLog(...args);
};
}
};
}

0 comments on commit 130611d

Please sign in to comment.