You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
MagicMiddleware.redirectTargetFor(Uri uri, String location) gives a redirect guard the full URI.redirectTarget receives the matched location, which carries no query string, so an auth guard that recorded it as the intended URL sent the user back to /approve instead of /approve?code=ABC after login. The router now calls redirectTargetFor for every guard with state.uri and the matched location; the default returns redirectTarget(location), so a guard that overrides only redirectTarget receives exactly what it did before, and the loop check still compares the target with the matched location. A guard that needs the query overrides redirectTargetFor, compares paths with uri.path and records uri.toString(). (lib/src/http/middleware/magic_middleware.dart, lib/src/routing/magic_router.dart, doc/basics/middleware.md, doc/security/authentication.md)