Only call setAuthCookie on local

This commit is contained in:
rotimi-best
2021-08-21 10:18:10 +03:00
parent 3d814d3cff
commit f2db3e19bf
3 changed files with 35 additions and 7 deletions
+31 -6
View File
@@ -2,27 +2,52 @@
export let status; export let status;
export let error; export let error;
const dev = process.env.NODE_ENV === 'development'; // const dev = process.env.NODE_ENV === 'development';
let errorContent;
// function report() {}
$: {
try {
errorContent = !!error ? JSON.stringify(error) : '';
} catch (error) {}
}
</script> </script>
<svelte:head> <svelte:head>
<title>{status}</title> <title>{status}</title>
</svelte:head> </svelte:head>
<h1>{status}</h1> <div class="w-3/5 h-3/5 m-auto flex flex-col items-center justify-center">
<h1>Opps 😢</h1>
<h2>Something wen't wrong and it's our fault.</h2>
<p>Please screenshot this page and send to me.</p>
<pre>
{errorContent}
</pre>
</div>
<p>{error.message}</p> <!-- {#if dev && error.stack}
<h1>{status}</h1>
{#if dev && error.stack} <p>{error.message}</p>
<pre>{error.stack}</pre> <pre>{error.stack}</pre>
{/if} {/if} -->
<style> <style>
h1, h1,
p { p {
margin: 0 auto; margin: 0 auto;
} }
pre {
width: 500px;
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word;
}
h1 { h1 {
font-size: 2.8em; font-size: 2.8em;
font-weight: 700; font-weight: 700;
+3 -1
View File
@@ -99,7 +99,9 @@
const { data: authListener } = supabase.auth.onAuthStateChange( const { data: authListener } = supabase.auth.onAuthStateChange(
(event, session) => { (event, session) => {
handleAuthChange(event, session); if (config.isDev) {
handleAuthChange(event, session);
}
if (event === 'SIGNED_IN') { if (event === 'SIGNED_IN') {
$user.fetchingUser = true; $user.fetchingUser = true;
+1
View File
@@ -11,6 +11,7 @@ import { getSupabase } from './utils/functions/supabase';
dotenv.config(); dotenv.config();
const config = { const config = {
isDev: process.env.NODE_ENV === 'development',
telegramToken: process.env.SVELTE_APP_TELEGRAM_API_TOKEN, telegramToken: process.env.SVELTE_APP_TELEGRAM_API_TOKEN,
supabaseConfig: { supabaseConfig: {
url: process.env.SVELTE_APP_SUPABASE_URL, url: process.env.SVELTE_APP_SUPABASE_URL,