Skip to content

Instantly share code, notes, and snippets.

View wiverson's full-sized avatar

Will Iverson wiverson

View GitHub Profile
@wiverson
wiverson / index.js
Created August 2, 2021 00:29
Tweaking Supabase auth to set cookies for server-side languages.
const SUPABASE_URL = 'https://<project>.supabase.co';
const SUPABASE_KEY = 'fancy long key';
var supabase = supabase.createClient(SUPABASE_URL, SUPABASE_KEY);
supabase.auth.onAuthStateChange((event, session) => {
console.log(event, session);
setToken(session);
})
window.userToken = null;