-
Notifications
You must be signed in to change notification settings - Fork 756
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
Create User invalid request has a response which returns 500 #5228 #5229
Create User invalid request has a response which returns 500 #5228 #5229
Conversation
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.
Although I understand the desired goal here, this does introduce a process change, and you might be masking an error that would have historically been logged.
For example, UserCreate can fail for password, duplicate email, or other reasons. This process now assumes that all failures are invalid passwords which is not correct. I think if any attempt to bypass logging etc should be adjusted.
Now, I could be convinced that ALL errors should be a 400 response, rather than a 500 though?
@dnnsoftware/approvers any thoughts?
I'm thinking we should be using Perhaps you are on to something though with the |
You are right for the naming, we can change InvalidPasswordException to InvalidUserRegistrationException. This was because I was thinking that I can define password error at the beginning. So the error is coming from https://github.com/dnnsoftware/Dnn.Platform/blob/develop/DNN%20Platform/Library/Entities/Users/UserController.cs#L779 and all of them are user validation error. Please see last commit. |
Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/UsersController.cs
Show resolved
Hide resolved
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.
This looks acceptable to me
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.
LGTM
Fixes #5228
Summary
When you try to change any user password, invalid password set causes an error response has a status code of 500 which is system exception.