Skip to content

Commit

Permalink
[go_router] chore(docs): update redirection example in readme (#2686)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan-Nelson authored Oct 13, 2022
1 parent 37f5ecb commit 5d23067
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/go_router/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ GoRouter(
...
redirect: (context, state) async {
if (await LoginService.of(context).isLoggedIn) {
return state.location;
// No redirect is required if the user is already logged in.
return null;
}
return '/login';
},
Expand Down

0 comments on commit 5d23067

Please sign in to comment.