Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/route guard redirect #31

Closed

Conversation

CasperPas
Copy link

Implementation for redirect feature mention at #28

This PR included commits from these PRs:

Example

SailorRoute(
  name: 'user_info',
  builder: (context, args, params) => UserInfoPage(),
  routeGuards: [
    SailorRouteGuard.simple((context, args, params) async {
      if (userBloc.isLoggedIn) {
        return true;
      } else {
        // Redirect to login page
        return RouteArgsPair('/login');
      }
    }),
  ],
),

@gurleensethi
Copy link
Owner

gurleensethi commented Feb 18, 2020

Thanks for the PR.
Appreciate the community's efforts to improve Sailor.
While this does solve the problem, its not the ideal solution. I will be updating the library in coming days, it will be a major refactor and will provide a way where it will allow for redirects.

@CasperPas CasperPas deleted the feature/route_guard_redirect branch February 18, 2020 03:30
@rlee1990
Copy link

rlee1990 commented May 8, 2020

@gurleensethi are there any updates on when this will be released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants