comments for pass.cpp
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/05/10 22:06:22 by aortigos #+# #+# */
|
||||
/* Updated: 2026/05/10 22:39:03 by aortigos ### ########.fr */
|
||||
/* Updated: 2026/05/10 22:45:31 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -19,6 +19,7 @@ void Server::pass_cmd(User &client, std::istringstream &ss)
|
||||
ss >> args;
|
||||
if (client.isAuthenticated())
|
||||
{
|
||||
// Still need to find what server should reply to different errors
|
||||
std::string res = "You are already authenticated";
|
||||
send(client.getFd(), res.c_str(), res.size(), 0);
|
||||
return ;
|
||||
@@ -26,6 +27,7 @@ void Server::pass_cmd(User &client, std::istringstream &ss)
|
||||
if (this->password_ == args)
|
||||
client->authenticated = true;
|
||||
else {
|
||||
// Still need to find what server should reply to different errors
|
||||
std::string res = "Invalid password";
|
||||
send(client.getFd(), res.c_str(), res.size(), 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user