sanser
sanser
Explore posts from servers
BABetter Auth
Created by sanser on 3/7/2025 in #help
401 doing listActiveSubscriptions on server side
Hey all im using svelte5 and better auth im trying to preload the subscription data in the +page.server.ts but im getting unauthorized when attempting to do so- when using the auth client it works fine?
export const load = async ({ request }) => {
const session = await auth.api.getSession({
headers: request.headers
});

if (!session) {
console.log('no session');
throw redirect(302, '/authenticate');
}

const data = await auth.api.listActiveSubscriptions();

const activeSubscription = data?.find(
(sub) => sub.status === 'active' || sub.status === 'trialing'
);

return { activeSubscription };
};
export const load = async ({ request }) => {
const session = await auth.api.getSession({
headers: request.headers
});

if (!session) {
console.log('no session');
throw redirect(302, '/authenticate');
}

const data = await auth.api.listActiveSubscriptions();

const activeSubscription = data?.find(
(sub) => sub.status === 'active' || sub.status === 'trialing'
);

return { activeSubscription };
};
22 replies
BABetter Auth
Created by sanser on 3/5/2025 in #bug-reports
404 with stripe plugin
hey all im getting a 404 when trying to get a stripe url:
const { data, error } = await client.subscription.upgrade({
annual: biAnnual,
plan: 'basic',
successUrl: '/dashboard',
cancelUrl: '/pricing'
});
console.log(data, error);
if (error) console.error(error.message);
const { data, error } = await client.subscription.upgrade({
annual: biAnnual,
plan: 'basic',
successUrl: '/dashboard',
cancelUrl: '/pricing'
});
console.log(data, error);
if (error) console.error(error.message);
/api/auth/subscription/upgrade 404 its also not generating my schema for stripe using the CI tool- the Session table was not created. using svelte5
2 replies
BABetter Auth
Created by sanser on 3/5/2025 in #help
/api/auth/subscription/upgrade 404 with stripe plugin
hey all- im doing this to create a checkout
const { data, error } = await client.subscription.upgrade({
annual: biAnnual,
plan: 'basic',
successUrl: '/dashboard',
cancelUrl: '/pricing'
});
const { data, error } = await client.subscription.upgrade({
annual: biAnnual,
plan: 'basic',
successUrl: '/dashboard',
cancelUrl: '/pricing'
});
but i'm getting an error saying the /api/auth/subscription/upgrade route does not exist?
6 replies
BABetter Auth
Created by sanser on 2/2/2025 in #help
linkSocial with custom OAuth providers
No description
25 replies
CDCloudflare Developers
Created by sanser on 6/7/2024 in #pages-help
some peer dependencies are incorrectly met with sveltekit
Hey all im currently getting some strange issues when building in cloudflare, issues dont seem to happen in vercel and locally they are just warnings and work fine, any ideas on this failing, i have set YARN_VERSION to 3 aswell but still same issue
4 replies
DTDrizzle Team
Created by sanser on 4/4/2024 in #help
Error: SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing
i seem to be getting this error when i run my drizzle-kit push:pg
Error: SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing
Error: SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing
the database url is from supabase!
3 replies
CDCloudflare Developers
Created by sanser on 3/31/2024 in #pages-help
postgres in pages
how can i use postgres using sveltekit with pages and drizzle ORM? im using pg atm but im getting these errors when building;
18:24:51.574 node_modules/pg/lib/stream.js:21:20:
18:24:51.574 21 │ var tls = require('tls')
18:24:51.574 ╵ ~~~~~
18:24:51.574
18:24:51.575 Cannot use "tls" when deploying to Cloudflare.
18:24:51.575
18:24:51.575
18:24:51.575 ✘ [ERROR] Could not resolve "fs"
18:24:51.575
18:24:51.575 node_modules/pgpass/lib/index.js:4:17:
18:24:51.575 4 │ , fs = require('fs')
18:24:51.575 ╵ ~~~~
18:24:51.576
18:24:51.576 Cannot use "fs" when deploying to Cloudflare.
18:24:51.574 node_modules/pg/lib/stream.js:21:20:
18:24:51.574 21 │ var tls = require('tls')
18:24:51.574 ╵ ~~~~~
18:24:51.574
18:24:51.575 Cannot use "tls" when deploying to Cloudflare.
18:24:51.575
18:24:51.575
18:24:51.575 ✘ [ERROR] Could not resolve "fs"
18:24:51.575
18:24:51.575 node_modules/pgpass/lib/index.js:4:17:
18:24:51.575 4 │ , fs = require('fs')
18:24:51.575 ╵ ~~~~
18:24:51.576
18:24:51.576 Cannot use "fs" when deploying to Cloudflare.
7 replies
DTDrizzle Team
Created by sanser on 3/29/2024 in #help
better way to check truthy / falsey from select
Hey all, currently checking if the length > 0 and <1 to check truthy / falsey is there a better way to do this with drizzle? if (existingUser.length > 0)
5 replies
DTDrizzle Team
Created by sanser on 11/15/2023 in #help
Using cloudflare pages postgres and lucia
Hey all im running into so many issues trying to get this setup, has anyone done this before, i have tried to use createClient, sql and createPool from @vercel/postgres but i cant get it working, does anyone have an example of how do this? i want to use a direct connection to my postgres db
4 replies