Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

Cannot Hot Link to Private Routes After Authentication


Using demo 1 React version, after login and at the main dashboard page if I select a bookmark or paste in a url to a protected page it redirect to the auth page? That should not be by design. Is there a bug right now?


Text formatting options
Submit

Replies (2)


Yes, it is a bug, this accessToken is undefined since the variable name in files Registration.tsx and Login.tsx doesn't match the actual name from the API.

We will include a fix in the upcoming Metronic v8.0.34 release.

Now as a temporary solution you can update the following files:
1)src/app/modules/auth/models/AuthModel.ts, replace accessToken property with access_token.
2)Update src/app/modules/auth/components/Registration.tsx and src/app/modules/auth/components/Login.tsx, in onSubmit function accessToken variable must be access_token as well.



It's because the accessToken is undefined from your auth API


Text formatting options
Submit
Text formatting options
Submit