Skip to content

Conversation

martakam
Copy link
Member

@martakam martakam commented Oct 19, 2026 •

This PR adds OAuth from other services (GitHub and Discord) to make it even easier to log in or sign up to our app.
better-auth takes care of connecting email and password accounts with OAuth accounts, so that the same user doesn't have two different accounts depending on the way they log in.

To be merged after #45 since this PR builds upon that

@martakam martakam requested a review from a team as a code owner October 19, 2026 18:04
Copy link
Member

@hestro hestro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really cool feature!

It would be nice to have a short guide in the README explaining what needs to be set up to get this working. I couldn't get Discord login to work when giving it a quick test

@martakam martakam self-assigned this Oct 20, 2026
@martakam martakam added the enhancement New feature or request label Oct 20, 2026
@martakam martakam added this to the Deliverable 3 milestone Oct 20, 2026
@martakam martakam linked an issue Oct 20, 2026 that may be closed by this pull request
Copy link
Member

@johahor johahor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing VITE_APP_URL fails silently with “Invalid callbackURL”. callbackURL is built as ${import.meta.env.VITE_APP_URL}/project2/. Without frontend/.env, it becomes undefined/project2/, and better-auth rejects it with a 403. Nothing in the UI says why. Suggest either import.meta.env.VITE_APP_URL ?? window.location.origin, or better, a relative callbackURL: import.meta.env.BASE_URL so no extra env variable is needed. Also show a toast when signIn.social returns an error, and document VITE_APP_URL in deployment.md.

AI generated comment ^

@johahor
Copy link
Member

johahor commented Oct 22, 2026

It's a nice feature, I agree with @hestro on that. However, if this is too much trouble to integrate into the website it might be worth atleast pausing until the criteria of milestone 3 is met. That being said, if this is something you like to work on, I'm not going to stop you from it.

@martakam
Copy link
Member Author

Missing VITE_APP_URL fails silently with “Invalid callbackURL”. callbackURL is built as ${import.meta.env.VITE_APP_URL}/project2/. Without frontend/.env, it becomes undefined/project2/, and better-auth rejects it with a 403. Nothing in the UI says why. Suggest either import.meta.env.VITE_APP_URL ?? window.location.origin, or better, a relative callbackURL: import.meta.env.BASE_URL so no extra env variable is needed. Also show a toast when signIn.social returns an error, and document VITE_APP_URL in deployment.md.

AI generated comment ^

We cannot have a relative link like that, since that would send us to the backend at port 3001 after the login at GitHub/Discord is done. That's why we need to build a full link.

However, thanks for mentioning the issue that comes up if the environment variable is not defined. I have now explicitly documented this, and the fallback you mention with using window.location.origin is implemented in 1f5f82f

@martakam martakam requested review from johahor and hestro October 24, 2026 22:49
@martakam
Copy link
Member Author

The issues mentioned should be fine, and I also provided some documentation in aa0a6a6 so it should be easier to test. Let me know if you guys encounter any difficulties

Copy link
Member

@hestro hestro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Tested both GitHub and Discord login and they work as expected

Sign in to join this conversation on GitHub.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add social logins
3 participants