Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
47778840
Commit
47778840
authored
9 years ago
by
Marcelo Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
Fixed error: when allow change username was set to false, registration failed.
parent
9b4f872d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/rocketchat-lib/server/methods/setUsername.coffee
+4
-4
4 additions, 4 deletions
packages/rocketchat-lib/server/methods/setUsername.coffee
with
4 additions
and
4 deletions
packages/rocketchat-lib/server/methods/setUsername.coffee
+
4
−
4
View file @
47778840
...
...
@@ -3,12 +3,12 @@ Meteor.methods
if
not
Meteor
.
userId
()
throw
new
Meteor
.
Error
(
'invalid-user'
,
"[methods] setUsername -> Invalid user"
)
unless
RocketChat
.
settings
.
get
(
"Accounts_AllowUsernameChange"
)
throw
new
Meteor
.
Error
(
403
,
"[methods] resetAvatar -> Invalid access"
)
user
=
Meteor
.
user
()
console
.
log
'[methods] setUsername -> '
.
green
,
'userId:'
,
Meteor
.
userId
(),
'arguments:'
,
arguments
if
user
.
username
?
and
not
RocketChat
.
settings
.
get
(
"Accounts_AllowUsernameChange"
)
throw
new
Meteor
.
Error
(
403
,
"[methods] setUsername -> Username change not allowed"
)
user
=
Meteor
.
user
()
console
.
log
'[methods] setUsername -> '
.
green
,
'userId:'
,
Meteor
.
userId
(),
'arguments:'
,
arguments
if
user
.
username
is
username
return
username
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment