Long delay after logging in with Apple (white screen)
It works but it causes quite a delay. What can I do to fix this?
auth.ts
apple-auth-button.tsx
8 Replies
make sure to index your db fields
Optimizing for Performance | Better Auth
A guide to optimizing your Better Auth application for performance.
The db is convex, only 2 rows in it. Every other request is fast. It was also this slow when using auth.js
I dont think this is a db performance issue.
do you know why the screen is white? My app's rendering is super fast.
@bekacru I've added the indexes on the collections and added the cookie cache, but it's unfortunately not any faster. Do you have any other suggestions?
Thanks for the help so far!
try to check where the latency is coming from. see the db logs if it's slow because of db queries. Other than db query, from better auth server side there shouldn't be anything that signficant. Try to see if any other thing is going on, in the client side.
Its these 3 requests taking together more than 2.5 seconds.

https://progressmade.ai/api/auth/subscription/list
https://progressmade.ai/api/auth/get-session
https://progressmade.ai/api/auth/subscription/list
I've had to remove the caching on the session, because it would not allow the user to update the profile and see the result
But the list call is made twice and takes a very long time.
The server is in my region. I see that email auth also takes 2 seconds.

However only for Apple you see a white screen, before it's rendering the