LoLesttK
LoLesttK
Explore posts from servers
BABetter Auth
Created by Anup on 2/27/2025 in #help
Cookies not working in next js middleware
try this
const cookie = request.cookies.get("better-auth.session_token")
const cookie = request.cookies.get("better-auth.session_token")
3 replies
BABetter Auth
Created by LoLesttK on 1/18/2025 in #help
OAuth skill issue
Sorry for not responding i was out of town for a while. i managed to make it work like this.. altho im not sure its the best way but it works. ( Client side )
<button
onclick={async () => {

await authClient.signIn.social(
{ provider: "github" },
{
onSuccess: (r) => {
window.location.href = r.data; // r.data = res.url from server
},
},
);
}}>SignIn</button
<button
onclick={async () => {

await authClient.signIn.social(
{ provider: "github" },
{
onSuccess: (r) => {
window.location.href = r.data; // r.data = res.url from server
},
},
);
}}>SignIn</button
( Server side )
// API: /api/auth/sign-in/social
export async function POST(event: RequestEvent) {

const db = event.locals.db;
const auth = initAuth(db);

const res = await auth.api.signInSocial({
body: {
provider: "github",
callbackURL: "/callback/github",
},
});

return new Response(res.url as string);
}
// API: /api/auth/sign-in/social
export async function POST(event: RequestEvent) {

const db = event.locals.db;
const auth = initAuth(db);

const res = await auth.api.signInSocial({
body: {
provider: "github",
callbackURL: "/callback/github",
},
});

return new Response(res.url as string);
}
// callback api route
//API: /api/auth/callback/github
// callback api route
//API: /api/auth/callback/github
10 replies
BABetter Auth
Created by LoLesttK on 1/18/2025 in #help
OAuth skill issue
i don't have disabledFetchPlugins. And to be clear i get redirect to my endpoint /api/auth/sign-in/social when in practice i want it to go to github sign-in page and go back to my redirect url...
10 replies
BABetter Auth
Created by LoLesttK on 1/18/2025 in #help
OAuth skill issue
the flow above thats not what happening.. all i get is a redirect with the signin/signup
10 replies
CDCloudflare Developers
Created by LoLesttK on 1/4/2025 in #pages-help
Functions prod vs dev
oh thats dope! i've tried that and it worked. Only thing is taking the Start part of the SolidStart and leaves us with Solid. which is fine because the workers just can be used as the backend. Youre a legend man! 😄
13 replies
CDCloudflare Developers
Created by LoLesttK on 1/4/2025 in #pages-help
Functions prod vs dev
yes the build generates a _worker.js file... totally my skill issue.. i was assuming i needed to configure it manually and file routing was the default. Thank you so much for help !🙏
13 replies
CDCloudflare Developers
Created by LoLesttK on 1/4/2025 in #pages-help
Functions prod vs dev
My setup is a SolidStart project.. maybe somethign with the config masses this up :\
13 replies