Require username to be different when editing it

This commit is contained in:
Chi Vinh Le
2017-06-21 21:18:28 +07:00
parent 6628e6d08d
commit f709057933
6 changed files with 73 additions and 26 deletions
+8 -1
View File
@@ -161,7 +161,13 @@ const ErrInstallLock = new APIError('install lock active', {
// ErrPermissionUpdateUsername is returned when the user does not have permission to update their username.
const ErrPermissionUpdateUsername = new APIError('You do not have permission to update your username.', {
translation_key: 'EDIT_USERNAME_NOT_AUTHORIZED',
status: 500
status: 403
});
// ErrSameUsernameProvided returned attempts to update their username with the same username.
const ErrSameUsernameProvided = new APIError('Same username provided.', {
translation_key: 'SAME_USERNAME_PROVIDED',
status: 400
});
// ErrLoginAttemptMaximumExceeded is returned when the login maximum is exceeded.
@@ -209,6 +215,7 @@ module.exports = {
ErrAuthentication,
ErrNotAuthorized,
ErrPermissionUpdateUsername,
ErrSameUsernameProvided,
ErrSettingsInit,
ErrInstallLock,
ErrLoginAttemptMaximumExceeded,