Merge staging: Auto-redirect after authentication#222
Merged
zainfathoni merged 1 commit intomainfrom Feb 10, 2026
Merged
Conversation
* feat(auth): auto-redirect after authentication When a user tries to access a protected route without being authenticated, the original URL is saved in session and they are redirected back after successful magic link login. Closes rb-logic.1 Amp-Thread-ID: https://ampcode.com/threads/T-019c17af-6967-74be-8e42-6191059b8d63 Co-authored-by: Amp <amp@ampcode.com> * test(auth): add unit and e2e tests for auto-redirect - Unit tests for redirect URL construction and preservation - E2E tests for unauthenticated redirect flow and authenticated redirect Amp-Thread-ID: https://ampcode.com/threads/T-019c17af-6967-74be-8e42-6191059b8d63 Co-authored-by: Amp <amp@ampcode.com> * feat(auth): redirect to dashboard for insufficient permissions - Add permission check in dashboard.transactions.$transactionId.$action loader - Standardize all permission redirects to /dashboard instead of various paths - Add comprehensive unit tests for permission functions - Add E2E tests for permission redirect behavior Closes rb-logic.2 Amp-Thread-ID: https://ampcode.com/threads/T-019c17de-be40-76a8-a962-78347f08fdda Co-authored-by: Amp <amp@ampcode.com> * fix(e2e): add admin fixture to global setup The permission-redirect.spec.ts tests use authFixtures.admin, but the global setup was not generating admin.local.json. This caused all Admin role tests to fail in CI with: 'ENOENT: no such file or directory, open e2e/fixtures/auth/admin.local.json' --------- Co-authored-by: Amp <amp@ampcode.com>
zainfathoni
approved these changes
Feb 10, 2026
Owner
zainfathoni
left a comment
There was a problem hiding this comment.
LGTM - staging changes look safe. CI passed.
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
Merges staging branch containing authentication improvements and permission fixes.
Changes from PR #212
Auto-redirect after authentication
redirectTofrom URL params, store in session, preserve through magic link flowredirectTofrom session and redirect there after successful authPermission redirects
dashboard.transactions.$transactionId.$actionloader/dashboardinstead of inconsistent pathsFlow
/dashboard/courses(protected)requireUserredirects to/login?redirectTo=/dashboard/coursesredirectToin session and sends magic link/magicreads session and redirects to/dashboard/courses/dashboardTests included
Previous PR: #212 (feat(auth): auto-redirect after authentication)