pica/handler/register.h
2023-12-22 20:25:20 -03:00

35 lines
646 B
C++

// SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include "handler.h"
class Server;
namespace Handler {
class Register : public Handler {
public:
Register(Server* server);
void handle(Request& request) override;
enum class Result {
success,
noLogin,
emptyLogin,
loginExists,
loginPolicyViolation,
noPassword,
emptyPassword,
passwordPolicyViolation,
unknownError
};
private:
void error(Request& request, Result result, Response::Status code);
private:
Server* server;
};
}