Cory
Cory
Explore posts from servers
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
@bekacru I think this is promising
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
No description
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
Hm I wonder if this is related?
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
Well either way this does not seem like a better-auth error so I will figure it out
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
ugh
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
No description
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
Interesting, switching to node-postgres seems to get rid of the error but now I am getting another error
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
Maybe drizzle-orm/postgres-js
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
I wonder if it's the drizzle adapter somehow?
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
Something on every request is going on
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
Still the same issue unfortunately
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
Ok I'll try
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
Interesting. Shouldn't it share request context? I thought that was the point
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
Well here is my hooks code, if you don't mind combing over it, does it look fine to you?
const authHandle: Handle = async ({ event, resolve }) => {
const { locals, request } = event;

if (event.route.id?.includes('(app)')) {
// Refresh or get the existing session
const session = await auth.api.getSession({
headers: request.headers
});

// Handle unauthenticated users
if (!session) {
// Redirect to login page for app routes
throw redirectToLogin(event.url);
}

// SUCCESS - User has been authenticated.
// Pass the user and session to locals so it can be easily access in endpoints and server side events
locals.session = session.session;
locals.user = session.user;

// If the user email is not verified and they are not already
// on the verification page, redirect them
if (!event.route.id?.includes('email-verification') && !session.user.emailVerified) {
redirect(302, route('/email-verification'));
}
}

return svelteKitHandler({ event, resolve, auth });
};

const svelteKitHandle: Handle = async ({ event, resolve }) => {
...
}

export const handle = sequence(authHandle, svelteKitHandle);
const authHandle: Handle = async ({ event, resolve }) => {
const { locals, request } = event;

if (event.route.id?.includes('(app)')) {
// Refresh or get the existing session
const session = await auth.api.getSession({
headers: request.headers
});

// Handle unauthenticated users
if (!session) {
// Redirect to login page for app routes
throw redirectToLogin(event.url);
}

// SUCCESS - User has been authenticated.
// Pass the user and session to locals so it can be easily access in endpoints and server side events
locals.session = session.session;
locals.user = session.user;

// If the user email is not verified and they are not already
// on the verification page, redirect them
if (!event.route.id?.includes('email-verification') && !session.user.emailVerified) {
redirect(302, route('/email-verification'));
}
}

return svelteKitHandler({ event, resolve, auth });
};

const svelteKitHandle: Handle = async ({ event, resolve }) => {
...
}

export const handle = sequence(authHandle, svelteKitHandle);
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
Yea
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
I mean something that changed on cloudflares end
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
Yea it’s not just with sign-in. Seems to happen whenever “get-session” is called but not 100%z Honestly I am wondering if this is a cloudflare issue or something
47 replies
BABetter Auth
Created by Cory on 2/8/2025 in #bug-reports
Running SvelteKit on Cloudflare workers I am getting this error
No that was on the client
47 replies
CDCloudflare Developers
Created by Mehedi on 1/13/2025 in #pages-help
Cloudflare & Sveltekit issue: when refresh a dynamic page throws 500 Internal error
I have been getting this same error!
8 replies