-
Notifications
You must be signed in to change notification settings - Fork 212
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
Fix redirect injection #361
Fix redirect injection #361
Conversation
@@ -127,7 +127,7 @@ describe('permission', function () { | |||
// THEN | |||
expect(redirectStateName).toBePromise(); | |||
expect(redirectStateName).toBeResolvedWith({state: 'adminRedirect'}); | |||
expect(adminRedirectTo).toHaveBeenCalledWith('ADMIN', jasmine.any(Object)); | |||
expect(adminRedirectTo).toHaveBeenCalledWith(PermRoleStore, 'ADMIN'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are used to assert the passed in, arbitrary injection values declared on the above $inject = [] assignment
} | ||
|
||
if (angular.isObject(redirection)) { | ||
} else if (angular.isObject(redirection)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to do this here since isObject([]) === true. It was re-defining the property as this function instead of the array-syntax injected function.
Currently after v5.x, redirectTo custom injection is broken. It was due to overridden $inject property.
Also, I removed the extraneous $inject properties used on the wrapped functions as I saw them as unneeded. I don't have a huge preference though if you really want them