AT
Size: a a a
AT
DR
DR
NE
NL
РС
PS
P
router.get("/auth/register", async ctx => {
ctx.type = "html";
ctx.body = fs.createReadStream("./src/server/views/register.html");
});
router.post("/auth/register", async ctx => {
const user = await queries.addUser(ctx.request.body);
return passport.authenticate("local", (err, user, info, status) => {
if (user) {
ctx.login(user);
// ctx.redirect("/auth/status");
} else {
ctx.status = 400;
ctx.body = { status: "error" };
}
})(ctx);
});
NE
РС
res.send('hello world');
PS
router.get("/auth/register", async ctx => {
ctx.type = "html";
ctx.body = fs.createReadStream("./src/server/views/register.html");
});
router.post("/auth/register", async ctx => {
const user = await queries.addUser(ctx.request.body);
return passport.authenticate("local", (err, user, info, status) => {
if (user) {
ctx.login(user);
// ctx.redirect("/auth/status");
} else {
ctx.status = 400;
ctx.body = { status: "error" };
}
})(ctx);
});
倫岡
SM
NE
倫岡
PS
const body = (await getRawBody(ctx.req)).toString();
P
М
SM
const body = (await getRawBody(ctx.req)).toString();
NE