Skip to content
Discussion options

You must be logged in to vote

I have found that if I create a new route for user.AdminEdit without the key requirement, then I get the base URL and can append it in jQuery in this way:

function switchUser(){
	var UserPick = $('#UserPick').val();
	$(location).prop('href', '<cfoutput>#urlFor(controller="user", action="AdminEdit")#</cfoutput>/' + UserPick);
}

This is working for me. I don't think it presents a security hole since the original route throws an error if the user removes the key value from the URL in the browser. Yet this allows the jQuery code to get the base path without a key.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by cfcoder
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants