aws-samples / aws-samples/remote-swe-agents
Redirect to the original url on sign-in callback
- Dominant language
- TypeScript
- Stars
- 243
- Forks
- 50
- Avg merge
- 1h 19m
- Merged PRs (30d)
- 24
Description
We can improve the below scenario:
1. User access a webapp session URL
2. Auth is expired, redirecting to sign-in page
3. User signs in
4. It now redirects to the root page instead of the url from step1
To improve this, we should store the URL in localStorage on redirect in step2, and restore it on another redircet on step4.
Redirect(step2) happens on Next.js middleware, so we can pass the original URL with HTTP header, and storing the URL in sign-in page. After a sucessful sign-in, it's always redirected to `auth-callback` page first. In the page we read the storage and redirect to the saved URL instead of root page.
Contributor guide
Research direction
Start by tracing the Next.js middleware redirect, the sign-in page, and the auth-callback page described in the issue. Verify how the original URL can be passed between these entry points and stored locally. Done means a signed-in user returns to the session URL they first requested instead of the root page.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- next.js, typescript
- Domain
- authentication, frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100