import { createClient } from "https://esm.sh/@supabase/supabase-js@2.10.0";
type Supabase = {
url: string;
key: string;
};
export async function main(auth: Supabase, email: string, password: string) {
const client = createClient(auth.url, auth.key);
const { data, error } = await client.auth.signInWithPassword({
email,
password,
});
if (error) {
return {
access_token: undefined,
refresh_token: undefined,
error: error.message,
};
}
return {
access_token: data?.session?.access_token,
refresh_token: data?.session?.refresh_token,
error: undefined,
};
}
Submitted by admin 496 days ago
import { createClient } from "https://esm.sh/@supabase/supabase-js@2.10.0";
type Supabase = {
url: string;
key: string;
};
export async function main(
auth: Supabase,
email: string,
password: string,
) {
const client = createClient(auth.url, auth.key);
const { data, error } = await client.auth.signInWithPassword({email, password})
if(error) {
return {
access_token: undefined,
refresh_token: undefined,
error: error.message
}
}
return {
access_token: data?.session?.access_token,
refresh_token: data?.session?.refresh_token,
error: undefined
}
}
Submitted by admin 500 days ago
import { Resource } from "https://deno.land/x/windmill@v1.85.0/mod.ts";
import { createClient } from "https://esm.sh/@supabase/supabase-js@2.10.0";
export async function main(
auth: Resource<"supabase">,
email: string,
password: string,
) {
const client = createClient(auth.url, auth.key);
const { data, error } = await client.auth.signInWithPassword({email, password})
if(error) {
return {
access_token: undefined,
refresh_token: undefined,
error: error.message
}
}
return {
access_token: data?.session?.access_token,
refresh_token: data?.session?.refresh_token,
error: undefined
}
}
Submitted by adam186 628 days ago
import { Resource } from "https://deno.land/x/windmill@v1.76.0/mod.ts";
import { createClient } from "https://esm.sh/@supabase/supabase-js@2.10.0";
export async function main(
auth: Resource<"supabase">,
email: string,
password: string,
) {
const client = createClient(auth.url, auth.key);
const { data, error } = await client.auth.signInWithPassword({email, password})
if(error) {
return {
access_token: undefined,
refresh_token: undefined,
error: error.message
}
}
return {
access_token: data?.session?.access_token,
refresh_token: data?.session?.refresh_token,
error: undefined
}
}
Submitted by adam186 636 days ago