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.
GitHub
Getting Discord Guilds · nextauthjs next-auth · Discussion #3774
Question 💬 Hello, I've been reading the docs and trying stuff out for sometime now, with callbacks, changing scopes, playing with prisma and so one. Despite all of this, I just can't figure...
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?