yog
03/06/2023, 10:29 PMsignInWithOtp
and would receive an error saying: This account does not exist
.
I can work around this issue by calling a signUp method if signInWithOtp
fails because the user doesn't have an account, but it sends the OTP so it would be very confusing to the user (and to me) why they are receiving a password to log in when they don't even have an account registered. I guess my question is how can I check if a user has an account or not before I let them sign in?Rake
03/06/2023, 10:47 PMtsx
const { data, error } = await supabase.auth.signUp({
email: event.target.email.value,
password: event.target.password.value,
options: {
data: {
username: event.target.username.value,
pro: false
}
}
});
I've also noticed this doesn't actually sign me in... I would appreciate some help with that tooDYELbrah
03/06/2023, 10:51 PMShashanKaf
03/06/2023, 10:53 PMzciwor
03/07/2023, 1:01 AMpax
03/07/2023, 1:07 AM./do-supabase-up
.
Whatever user action is available in the supabase admin UI, i want to access that through code
Thankspax
03/07/2023, 1:34 AMSpidey
03/07/2023, 2:00 AMth_m
03/07/2023, 4:42 AMTonkatsu
03/07/2023, 5:29 AMYu
03/07/2023, 6:30 AMNJ™
03/07/2023, 6:43 AMDrip
03/07/2023, 7:08 AMsupabase db push
on prod as well to keep it in syncawucado
03/07/2023, 7:33 AMAmara
03/07/2023, 8:23 AMlake_mattiato
03/07/2023, 8:42 AMdebrijja
03/07/2023, 9:02 AMkaaloo
03/07/2023, 9:07 AMsupabase start
with recent versions of the CLI (1.42.1 in this case installed via npm)
failed to register layer: Error processing tar file(exit status 1): Container ID 1389985163 cannot be mapped to a host ID
Retrying after 8s: public.ecr.aws/supabase/storage-api:v0.29.1
v0.29.1: Pulling from supabase/storage-api
Vimes
03/07/2023, 9:09 AMsql
CREATE VIEW kundeportal as
SELECT
audits.audit_name,
audits.slug as audit_slug,
timepott.name as timepott_name,
taas.description,
profiles.first_name,
profiles.last_name,
profiles.organization,
profiles.id,
organizations.slug
FROM profiles
RIGHT JOIN timepott
ON profiles.organization = timepott.organization
RIGHT JOIN taas
ON profiles.organization = taas.organization
RIGHT JOIN audits
ON profiles.organization = audits.organization
RIGHT JOIN organizations
ON profiles.organization = organizations.slug
WHERE profiles.organization = organizations.slug
AND profiles.id = auth.uid();
lake_mattiato
03/07/2023, 10:49 AM"Connection refused (os error 111)"
This is the code:
js
import {serve} from "https://deno.land/std@0.131.0/http/server.ts"
import {createClient} from 'https://esm.sh/@supabase/supabase-js@2'
import { SmtpClient } from "https://deno.land/x/smtp/mod.ts";
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey'
}
const getUser = async(supabase, email) => {
let { data, error } = await supabase
.from('user_data')
.select("*")
.eq('email', email)
if (error) return null
return data
}
serve(async (req) => {
const supabase = createClient(
Deno.env.get('SUPABASE_URL') ?? '',
Deno.env.get('SUPABASE_ANON_KEY') ?? '',
{ global: { headers: { Authorization: req.headers.get('Authorization')! } } }
)
try {
const data = await req.json()
const targetEmail = data.target_email
const userData = await getUser(supabase, data.source_email)
const code = userData[0].invitation_code
const client = new SmtpClient();
await client.connectTLS({
hostname: "smtp.gmail.com",
port: 587, // tried port 465 aleady
username: "wasta.noreply@gmail.com",
password: "password",
});
await client.send({
from: "wasta.noreply@gmail.com", // Your Email address
to: "example@mail.com", // Email address of the destination
subject: "Mail Title",
content: "Mail Content,maybe HTML",
});
await client.close();
await client.close();
return new Response(
JSON.stringify(message),
{ headers: { "Content-Type": "application/json" } },
)
} catch (error) {
return new Response(JSON.stringify({ message: error.message }), {
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
status: 400
})
}
})
Any idea how to fix this?AndreMiras
03/07/2023, 11:08 AMschmay
03/07/2023, 11:15 AMRazoth
03/07/2023, 11:24 AM@supabase/auth-helpers-nextjs
?Vimes
03/07/2023, 11:25 AMjs
const { data: profile, error } = await supabase
.from("profiles")
.select(
`id, first_name, last_name, organization(name, umbraco_id, umbraco_url, slug)`
)
.single();
const { data: taas } = await supabase
.from("taas")
.select(
`*`
);
But using this method I Cannot access error more than once, so I can only get error from the first query. how can I handle this?killerthief
03/07/2023, 1:04 PMjoaquimley
03/07/2023, 1:09 PMtable_b
that has to match two values:
table_a.id = id
(new item in table_b
will have the same id
as in table_a.id
Tried to ref: new.id
and simply id
but both fail,
Here's the failing insert in table_b
CHECK:
sql
EXISTS(
SELECT table_a.id, table_a.user_id
FROM table_a
WHERE (table_a.user_id = auth.uid())
AND table_a.id = <table_b.id|id|new.id>
)
The last condition is of showing all the options I've tried, not that is is a valid check.kresimirgalic
03/07/2023, 1:17 PMCREATE OR REPLACE FUNCTION get_threads(userId uuid)
RETURNS TABLE (
id uuid,
user_id uuid,
whom uuid,
subject TEXT,
created_at timestamp with time zone
) AS $$
BEGIN
RETURN QUERY
SELECT
DISTINCT ON (t.id)
t.id,
t.user_id,
t.whom,
m.message AS subject,
t.created_at AS thread_created_at
FROM
threads t
JOIN threads_message m ON t.id = m.thread_id
WHERE
(t.user_id = userId OR t.whom = userId)
AND m.created_at = (
SELECT
MAX(created_at)
FROM
threads_message
WHERE
thread_id = t.id
)
ORDER BY
t.id, m.created_at DESC;
END;
$$ LANGUAGE plpgsql;
Vishruta Patil
03/07/2023, 2:28 PMSaylessss
03/07/2023, 2:56 PMFailed to get project subscription: Subscription not found
This is not limited to just the billing page as other features also do not load because the subscription endpoint returns a 404. This impairs me from using Auth providers as well as many other features.
I do not know what the problem is. I am on a free tier but have put my card on file.
I wanted to make a support request, but it wouldn't even let me do that because of this error!
![image](https://user-images.githubusercontent.com/38445041/223458122-84b60a9f-b1cc-48b4-9f11-bb4f948ac702.png▾
th_m
03/07/2023, 4:32 PM