formigueiro
05/19/2023, 3:02 PMjs
const startOfMonth = spacetime().startOf('month').format('iso');
const endOfMonth = spacetime().endOf('month').format('iso');
const { data: statisticsData } = await supabase
.from('url_data')
.select('*, clicks(*)')
.eq('slug', slug)
.filter((query) => {
return query
.gte('clicks.created_at', startOfMonth)
.lte('clicks.created_at', endOfMonth);
})
.single();
https://cdn.discordapp.com/attachments/1109133886346235904/1109134192895336498/image.png▾
magenta
05/19/2023, 4:04 PMowodunni
05/19/2023, 4:14 PMHugo Peran
05/19/2023, 4:26 PMnode --trace-warnings ...
to show where the warning was created)
{
error: null,
data: null,
count: null,
status: 201,
statusText: 'Created'
}
I did follow the instructions and tried either .single() or .select() to have a response back. But nothing came
Here is my trial code for a single row insertion, that **DOES create a new row in my Supabase table
But gives me no response in terminal.**
const fs = require('fs');
const csv = require('csv-parser');
const { createClient } = require('@supabase/supabase-js');
const SUPABASE_URL = ""
const SUPABASE_ANON_KEY = "";
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY);
async function insertSingleRecord() {
const newCompany = {
name: 'Test Company',
country: 'Test Country',
company_website_url: 'https://testcompany.com',
founded: 2000,
industry: 'Test Industry'
};
const { data, error } = await supabase
.from('companies')
.insert(newCompany)
.single();
if (error) {
console.log(Error inserting data: ${error.message}
);
} else if (data) {
console.log(Inserting company data: ${data}
);
} else {
console.log(Unexpected response: ${JSON.stringify({data, error}, null, 2)}
);
}
}
insertSingleRecord();alphaboy
05/19/2023, 4:48 PMsignInWithTokenId
(google). Anyone has any idea?
I am using this package to login my user via google and get the `idToken`: https://github.com/react-native-google-signin/google-signinMhamad Othman
05/19/2023, 5:01 PMBearer ${userJWT}
,
},
uploadDataDuringCreation: true,
chunkSize: 6 * 1024 * 1024,
allowedMetaFields: [
"bucketName",
"objectName",
"contentType",
"cacheControl",
],
});
my rls for the bucket is this:-
CREATE POLICY "dw 1tghu4n_0" ON storage.objects FOR UPDATE TO authenticated USING (bucket_id = 'banners');
idk what the error is but my file gets uploaded but i dont want any console errorbombillazo
05/19/2023, 6:31 PMtsx
const { error } = await supabase.auth.resetPasswordForEmail(email, {
redirectTo: '/update-password',
});
But this is the link we get in our email:
https://PROJECT.supabase.co/auth/v1/verify?token=ABCD&type=recovery&redirect_to=https://our.domain.com/
We expect to see &redirect_to=https://our.domain.com/update-password
We have setup in the supabase auth/email section these emails:
Site URL:
- https://our.domain.com/
Redirect URLs
- https://our.domain.com
- https://our.domain.com/**
Why would supabase not respect the redirectTo
parameter?nlarusstone
05/19/2023, 9:35 PM"@supabase/auth-helpers-nextjs": "^0.5.2",
"@supabase/auth-helpers-react": "^0.3.1",
"@supabase/auth-ui-react": "^0.3.5",
"@supabase/gotrue-js": "^2.13.0",
"@supabase/supabase-js": "^2.2.0",
https://cdn.discordapp.com/attachments/1109232958960832523/1109232959451562034/Screen_Shot_2023-05-19_at_2.31.57_PM.png▾
https://cdn.discordapp.com/attachments/1109232958960832523/1109232959820664832/Screen_Shot_2023-05-19_at_2.31.08_PM.png▾
Agon
05/19/2023, 10:27 PMzwarag
05/19/2023, 10:30 PMdart
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:spacevault_cash/constants.dart';
import 'package:supabase_flutter/supabase_flutter.dart';
import 'package:supabase/supabase.dart' as supabase_;
import '../services/supabase_service.dart';
class TestPage extends ConsumerWidget {
const TestPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context, WidgetRef ref) {
final user = ref.watch(userProvider);
print(supabase.auth.currentSession);
// Use the user variable here
return ElevatedButton(
onPressed: () {
ref.read(supabaseProvider).auth.signInWithOAuth(
supabase_.Provider.github,
redirectTo: kIsWeb ? null : authRedirectUrl);
},
child: Text(user != null ? 'Logged in' : 'Login'),
);
}
}
I'm having trouble authenticating users when using the web client. When clicking on the button, the user gets redirected to github. After entering valid credentials, the users gets sent back to the application, however supabase.auth.currentSession
prints null
.
However, I can see the access_token in the url bar, so it should actually have everything it needs. Any Ideas?
PS: This works fine for iOS and AndroidHugos
05/19/2023, 11:33 PMjs
const { error } = await supabase.auth.signUp({
email: form.data.email,
password: form.data.password,
options: {
data: {
username: form.data.username
}
}
});
console.log(error);
sql
create or replace function public.handle_new_user()
returns trigger
language plpgsql
security definer set search_path = public
as $$
begin
insert into public.profiles (user_id, username)
values (new.id, new.raw_app_meta_data->>'username');
return new;
end;
$$;
truongsinh
05/20/2023, 1:50 AMpublic
schema, and rename another schema to public
, then nothing works. select graphql.rebuild_schema()
is no longer availalbemitchmeister
05/20/2023, 2:56 AMconnection to server at "db.XXXX.supabase.co" (9.9.9.9), port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?`
I've changed nothing since I last logged in a week ago. Any ideas why this might be? (API access is working)AdamJensen
05/20/2023, 4:34 AMapp_metadata
property, contains a string 'internal-admin'.
I have written the following so far, but am unsure as to check if that array contains one property (it can contain many properties btw).
https://cdn.discordapp.com/attachments/1109338215288164425/1109338215770488883/rls.PNG▾
Arinji
05/20/2023, 7:03 AMO2K
05/20/2023, 7:17 AMSanctus
05/20/2023, 8:09 AMts
import { supabase } from '$lib/db/supabase'
import type { BrdElem } from '$lib/types'
export async function updateBrdElemPos(brdElem: BrdElem): Promise<void> {
const { error } = await supabase.from('element').update({ pos: brdElem.pos }).eq('id', brdElem.id)
if (error) console.log(error)
}
However now supabase is defined in the +layout.ts file. It makes it really easy to access via load
in the "+" files, but I don't know how to access it from regular .svelte or .ts files.useless
05/20/2023, 8:33 AM/app
, supabase auth
& supabase/auth-helpers-nextjs
. when i log in, the user data
and session
are being stored in the local storage
and i don't want them visible for the user in the console. Moreover, how can i increase the cookie's max-age/ expiry date
.zwarag
05/20/2023, 9:32 AMdart
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:spacevault_cash/constants.dart';
import 'package:supabase_flutter/supabase_flutter.dart';
import 'package:supabase/supabase.dart' as supabase_;
import '../services/supabase_service.dart';
class TestPage extends ConsumerWidget {
const TestPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context, WidgetRef ref) {
final user = ref.watch(userProvider);
print(supabase.auth.currentSession);
// Use the user variable here
return ElevatedButton(
onPressed: () {
ref.read(supabaseProvider).auth.signInWithOAuth(
supabase_.Provider.github,
redirectTo: kIsWeb ? null : authRedirectUrl);
},
child: Text(user != null ? 'Logged in' : 'Login'),
);
}
}
I'm having trouble authenticating users when using the web client. When clicking on the button, the user gets redirected to github. After entering valid credentials, the users gets sent back to the application, however supabase.auth.currentSession
prints null
.
However, I can see the access_token in the url bar, so it should actually have everything it needs. Any Ideas?
Just for context: This works fine for iOS and Android0xMatei.nft
05/20/2023, 10:52 AMtypescript
export default function Dashboard() {
const supabaseClient = createBrowserSupabaseClient();
const [loading, setLoading] = useState(true);
const router = useRouter();
const user = useUser();
causes the tab to crash when switching between any tab and the Supabase app tabFranck
05/20/2023, 11:07 AMbaseurl/locale/dashboard
before clicking on sign in with google the url looks like this: baseurl/locale
once signed in the url is baseurl/locale#
It never goes to /dashboard
, despite having it setup properly in my redirect URLs with and without wildcards
Any idea how I could solve this? Could it be because the auth occurs in a modal? Could it be because of the locale being loaded a soon as the page refresh?
ThanksJohnny Robert
05/20/2023, 11:18 AMhttps://cdn.discordapp.com/attachments/1109440067736457320/1109440068197810216/Screenshot_at_May_20_14-14-03.png▾
https://cdn.discordapp.com/attachments/1109440067736457320/1109440068558524548/Screenshot_at_May_20_14-14-32.png▾
Corrupted
05/20/2023, 12:29 PMshnoman
05/20/2023, 12:34 PMWeykon
05/20/2023, 12:51 PMhttps://cdn.discordapp.com/attachments/1109463407075262495/1109464223878238208/image.png▾
Agon
05/20/2023, 12:51 PMServing functions with legacy supabase/deno-relay:v1.6.0... Run functions serve instead to use Edge Runtime.
why is it saying legacy?Jessy
05/20/2023, 1:09 PMcbunge3
05/20/2023, 2:41 PM.Volxen
05/20/2023, 5:16 PMMotz
05/20/2023, 5:16 PMVersion 1.30.3 is already installed
Bundling verbesserer
Error: Error bundling function: exit status 1
file:///D:/Users/Matthias/Desktop/Development/web/verbesserer/supabase/functions/import_map.json
error: Uncaught (in promise) Error: Error: Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch. (os error 123)
const ret = new Error(getStringFromWasm0(arg0, arg1));
^
at __wbg_new_8d2af00bc1e329ee (https://deno.land/x/eszip@v0.35.0/eszip_wasm.generated.js:513:19)
at <anonymous> (https://deno.land/x/eszip@v0.35.0/eszip_wasm_bg.wasm:1:1522549)
at <anonymous> (https://deno.land/x/eszip@v0.35.0/eszip_wasm_bg.wasm:1:1398157)
at <anonymous> (https://deno.land/x/eszip@v0.35.0/eszip_wasm_bg.wasm:1:1895031)
at __wbg_adapter_40 (https://deno.land/x/eszip@v0.35.0/eszip_wasm.generated.js:229:6)
at real (https://deno.land/x/eszip@v0.35.0/eszip_wasm.generated.js:213:14)
Which is more or less similar to the post linked, but even though the update to eszip v0.35.0 is in, it still doesn't work.
Maybe there is something wrong on my end? I'm running the latest version of supabase-cli (1.62.3
)