JROCBABY
Explore posts from serversBABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
Okay thanks bud, I asked around in the general, but I'll make a new help post. Appreciate the help.
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
If I use cookies() it retrieves abc123.xyz789 from the browser, and that's how I can see it in the developer tools > application > cookies as well
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
But that has nothing to do with axios? It's literally how better-auth inserts the cookie into the browser.
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
So when I send a cookie to the backend using withCredentials using axios or something and compare it with the token in the sessions table they don't match up
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
Better auth sets a cookie with token abc123.xyz789 in the browser. But in the sessions table the token only consists of abc123.
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
That's how to cookie is saved in the browser, abc123.xyz789, but when I look in the db the session token column only contains abc123
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
The client sends a token that includes an additional encoded segment (e.g., abc123.xyz789), while the database stores only the base part (e.g., abc123). This causes the server to reject the token as invalid, resulting in a 401 Unauthorized error.
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
I'm running into an issue where the client sends a token like xxxxxxxxxxx(dot)xxxxxxxxxxxxx but the sessions table only has the token part before the dot, this leads to 401 errors, any idea why the client sends xxxxxxxxxxx(dot)xxxxxxxxxxxxx?
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
one last thing, in the signInProvider, I also do a router.push(callbackURL);
is that also a bad idea?
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
wait you're right, when I reran the migration the null constraint disappeared, sorry!
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
Yeah maybe infer it from their email or something
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
No the issue is the unique constraint, I think that forces it to be not null, since otherwise if you'd have multiple null records, that would make it not unique
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
Is there anywhere I can see the schema's better auth expects? Because it generated this
At least, that's what I think, but now I'm getting
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
Yeah I missed that, but thanks again, I was pulling my hair out.
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
since there wasn't any error to go on really
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
Thank you so much, I would've never found this myself tbh
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
yeah it works now ty
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
yeah
83 replies
BABetter Auth
•Created by JROCBABY on 4/27/2025 in #help
BetterAuth GitHub OAuth Creates Only Verification Records, No User/Account/Session
83 replies