I currently have a form where you put in two variables and on submit it redirects to a url like this:
http://example.com/deal_user_coupons/check_qr/$var1/4var2
but when logged in as admin it goes to:
http://example.com/albuquerque/admin/deal_user_coupons/check_qr/$var1/$var2
Which makes it show a 404 page.
I was wondering how to get rid of the admin directory slash. I tried looking in the documentation and at a few acl tutorials but nothing came close.
You can redirect form on the exact page you need using url option.
$this->Form->create('Shutk',array('url'=>array('controller'=>'my_controller',
'action'=>'my_action',
'admin'=>false)
)
);
don't forget to use in url array. this will remove admin prefix from action attribute of the form.
'admin'=>false
Related
I have an onboarding page like this www.abc.com/ welcome. On continuing users land on /set-profile image page.
There is a Submit on this page.
When users click on Submit button, if the user has come from /welcome, I want users to go to the configuration page, else I want users to go to /home.
The issue I am facing is, I tried both window.location and use history but I can't figure out how to find the "from" location.
What I am doing wrong?
You can't access the browser history from JS (that would be a security issue).
What you can do is add a query string to your /set-profile route (such as ?returnTo=/welcome) and use it for the redirection.
I have my app located at https://www.pprhr.com/portal
However, when trying to login or out, it redirects to https://www.pprhr.com, which is incorrect, it's missing "portal" on the end. I cannot find where I set the redirectUri to the correct path. It does show in the logs that it is indeed pointing to the wrong path. I cannot find where to change it though.
My index.js simpley has this line: redirect_uri={window.location.origin}
Do I need to change this?
All of the callbacks in the application settings on the Auth0 site to have https://www.pprhr.com/portal
Please open your developer tools, go into the console and type:
window.location.origin
You will see that it isn't giving you the URL you want 😊
Instead, the href property is what you want.
How can i restrict users routes ?
I want to restrict users maually typing url in the address bar , for Eg: http://localhost:3000/admin if the user is in https://localhost/users.
I want only the admin to use the /admin route.
I'm trying to build multi user blog,
and for the route /admin,
i don't want normal users to maually type the route in address bar like http://localhost:3000/admin where the /admin route is only for admin ,
so whenever the user types manually in address bar as http://localhost:3000/admin
i want to display the error message and redirect the user back to root page.
I'm using useEffect of react and authenticating the user for normal user and admin and using Router.push('/') if the user is not admin and also want to display the page which says ENTRY RESTRICTED , the error message i am getting from the api by res.json().
It is working but the the issue is the user is still able to see the admin dashboard for like 2/3 secs,
and then it is being redirected to the root page.
I want to restrict that and display the message.
REPO :
https://github.com/nitink66/blog-frontend
https://github.com/nitink66/blog-backend
I'm also trying to not push node_modules folder into github by adding .gitignore but for some reasons it is not working.
For role based:
Follow React Rolebased example. This might be help to you
Repo:
to ignore node_modules
replace below code
/node_modules
I'm facing a problem don't know how to solve. I would like to get some light here.
Given an AngularJS application that routes using the standard $routerProvider, and considering the fact that whenever an end user tries to access a private area he gets redirected to the register area, happens the following:
User just landed onto de application (didn't get logged in).
User goes to /profile
The application checks whether there is session info in the client or not.
The application redirects to /profile/register
User clicks on "Back" button of the browser and goes to /profile.
(Next step is number 3 again and again).
This happens because each time the application redirects using the $routerProvider, it pushes all routes in the browser history.
My question is, how can I jump the failed /profile access over the browser history? How can I tell the browser do not save this route under given conditions
like the user is logged in?
FAQ regarding history: https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history
Supposing you're using the $location built-in service to redirect, you can use $location.replace() to replace the current history entry:
if (notLoggedIn) {
$location.url( "/profile/register" );
$location.replace();
}
Note that this will apply to current digest only, as noted in the API docs.
how can i redirect in dotnetnuke 5.3 + to a particular page?
DotNetNuke API is having helper methods for navigation. See DotNetNuke.Common.Globals.NavigateURL method overloads.
Depending on the various requirements, developers are using this method. for example, if you want to redirect to tab id 80 then you can simply write DotNetNuke.Common.Globals.NavigateURL(80) and it will redirect user to tab id 80
Please add more details about what you exactly want to implement so that I can point you towards some sample.
Hope this is helpful.
DotNetNuke.Common.Globals.NavigateURL() does not do a redirect, it simply creates a target URL based on the parameter you've provided.
Once you get that URL, you can either assign it to a hyperlink, or do a Response.Redirect() with it
If the included URL Rewriter doesn't do it for you, you can use Snapsis PageBlaster or the commercial iFinity Url Master Module (http://www.ifinity.com.au/Products/Url_Master_DNN_SEO_Urls). On a deeper level and if you are on IIS7, you can use the URL Rewrite function there.
Otherwise, you can try this:
Go to the page you want to redirect, page functions, settings
Find Advanced settings and then Other settings
Click the radio button "URL (Link to an external resource)" and fill the Location field
You can get TabID (Page ID) in c#/Vb.
Pass tab ID to function DotNetNuke.Common.Globals.NavigateURL(TabID)
This will return URL.