くりすた
BABetter Auth
•Created by くりすた on 3/11/2025 in #help
How to get a list of guilds a user is in on Discord using Better-Auth
Nice to meet you. This is my first time using Better-Auth.
With OAuth authentication by Discord, I would like to obtain the guild information the user is participating in as well as the user information via the endpoint. However, the access token cannot be found in the information returned by the session, so it cannot be fetched to the endpoint. In next-auth, you can obtain these using callbacks, but how can you implement this in better-auth?
I found an implementation example in next-auth, so I'd like to share it with you.
https://github.com/nextauthjs/next-auth/discussions/3774
The environment I am using is Next.js v14.2.23, the latest version of Better-Auth, and MySQL connection via Prisma.
2 replies