0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-01-14 00:34:18 +01:00

modules/console: Add user register cmd.

This commit is contained in:
Jason Volk 2018-06-07 13:28:50 -07:00
parent 51d657a533
commit ca1507cd48

View file

@ -5026,6 +5026,50 @@ console_id__user(opt &out,
return true;
}
bool
console_cmd__user__register(opt &out, const string_view &line)
{
const params param{line, " ",
{
"username", "password"
}};
const string_view &username
{
param.at(0)
};
const string_view &password
{
param.at(1)
};
const m::registar request
{
{ "username", username },
{ "password", password },
{ "bind_email", false },
};
using prototype = std::string
(const m::registar &,
const client *const &,
const bool &);
static m::import<prototype> register_user
{
"client_register", "register_user"
};
const auto ret
{
register_user(request, nullptr, false)
};
out << ret << std::endl;
return true;
}
bool
console_cmd__user__password(opt &out, const string_view &line)
{