Skip to content

Commit

Permalink
fix(user cmd): Remove validation error during auth
Browse files Browse the repository at this point in the history
  • Loading branch information
jdomingu98 committed May 9, 2024
1 parent 2cd2db1 commit 899791f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/UserCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void UserCommand::execute(int clientFd) {
Server& server = Server::getInstance();
User *user = server.getUserByFd(clientFd);

if (!user->getUsername().empty())
if (user->isRegistered() && !user->getUsername().empty())
throw AlreadyRegisteredException();
user->setUsername(_username);
user->setHostname(_hostname);
Expand Down

0 comments on commit 899791f

Please sign in to comment.