0
Supabase authentication

application protected by auth using supabase, sign in using email/password or magic link and auto refresh tokens

Created by josé governo425 551 days ago
Static preview only: No backend 
This is a static preview of the app and there is no backend. As such, the interactivity requiring script execution is non functional. To see the fully functional app, edit/run it in Windmil by clicking the button above.
Loading

Scripts used

// import * as wmill from "https://deno.land/x/windmill@v1.77.0/mod.ts"

import { Resource } from "https://deno.land/x/windmill@v1.77.0/mod.ts";
import { createClient } from "https://esm.sh/@supabase/supabase-js@2";

export async function main(
  auth: Resource<"supabase">,
  access_token: string,
  refresh_token: string,
) {
  const supabase = createClient(auth.url, auth.key, {
    global: { headers: { Authorization: `bearer ${access_token}` } },
  });
  const { data, error } = await supabase.from("profiles").select();
  return { data, error };
}