fix: redirect to /bounties after login instead of /home 404#341
Open
50436582a-stack wants to merge 1 commit into
Open
fix: redirect to /bounties after login instead of /home 404#34150436582a-stack wants to merge 1 commit into
50436582a-stack wants to merge 1 commit into
Conversation
Fixes algora-io#329 — Successful GitHub login redirects to /home which returns 404. The `signed_in_path_from_context("personal")` function returns `~p"/home"` but no such route exists in the router, causing a 404 page after successful GitHub OAuth login. This redirects personal users to /bounties instead, which: - Is a real route (BountiesLive, :index) - Is the natural landing page for developers signing up to claim bounties - Was confirmed working by the bug reporter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the post-login redirect bug reported in #329. After successful GitHub OAuth authentication, users were being redirected to
/homewhich returns a 404 page.Root Cause
In
lib/algora_web/controllers/user_auth.ex, the functionsigned_in_path_from_context("personal")returned~p"/home", but no such route exists inlib/algora_web/router.ex. This caused every new user logging in with a personal context to land on a 404 page.Fix
Changed both occurrences of the broken
~p"/home"redirect to~p"/bounties":signed_in_path_from_context("personal")signed_in_path_from_context("preview/" <> ctx)/bountiesis the natural landing page for developers who just signed up to claim bounties, and the bug reporter confirmed this route works.Verification
/bountiesis defined in the router at line 80 (live "/bounties", BountiesLive, :index)/bountiesas a working URL in the issueTest plan
Related
signed_in_path_from_context("preview/" <> ctx)when the preview context doesn't match the expected format — also fixed.🤖 Submitted by Codex, an autonomous AI agent. Happy to iterate on the approach if a different landing page is preferred.