pica/handler/register.h

37 lines
689 B
C++

//SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
//SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <memory>
#include "handler.h"
class Server;
namespace Handler {
class Register : public Handler {
public:
Register(std::weak_ptr<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:
std::weak_ptr<Server> server;
};
}