Skip to content

1.4.0

Latest

Choose a tag to compare

@github-actions github-actions released this 03 Dec 15:53
· 3 commits to master since this release
4ba8077

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)