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

[Bug] Redirect to /admin/dashboard upon invalid route #23

Closed
locmai0808 opened this issue Apr 6, 2020 · 2 comments
Closed

[Bug] Redirect to /admin/dashboard upon invalid route #23

locmai0808 opened this issue Apr 6, 2020 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@locmai0808
Copy link

Version

1.0.0

Reproduction link

https://code.lnmai.com/#/admin/dashboard

Operating System

Windows

Device

Desktop

Browser & Version

Chrome 80

Steps to reproduce

  1. Go to https://code.lnmai.com/#/admin/dashboard
  2. Edit the url to something like https://code.lnmai.com/#/admin/invalid and press enter

What is expected?

Expected the app would redirect to https://code.lnmai.com/#/admin/dashboard instead of staying on https://code.lnmai.com/#/admin/invalid

What is actually happening?

App wont redirect upon invalid route.


Solution

Additional comments

According to your demo page here: https://demos.creative-tim.com/black-dashboard-pro-react/#/admin/dashboard
When you go to https://demos.creative-tim.com/black-dashboard-pro-react/#/admin/invalid, it would redirect to dashboard, without refreshing the page.

lDLoUTb9SN

@einazare
Copy link
Contributor

einazare commented Apr 6, 2020

Hello there, @locmai0808 ,

I've checked our product and it works as expected.
As I can see on the links you have given me, you have made changed to our product.
Inside src/layouts/Admin/Admin.js inside the <Switch>...</Switch> component, you need to have a Redirect:

          <Switch>
            {this.getRoutes(routes)}
            <Redirect from="*" to="/admin/dashboard" />
          </Switch>

Also, please note this is not an issue with the product.

Best,
Manu

@einazare einazare closed this as completed Apr 6, 2020
@einazare einazare added the help wanted Extra attention is needed label Apr 6, 2020
@locmai0808
Copy link
Author

@einazare Thanks! That fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants