Formatting.

This commit is contained in:
mike12345567 2021-05-05 15:19:44 +01:00
parent 7b92046052
commit 3812a31a22
4 changed files with 15 additions and 4 deletions

View File

@ -47,7 +47,10 @@ exports.reset = async ctx => {
const { email } = ctx.request.body const { email } = ctx.request.body
const configured = await isEmailConfigured() const configured = await isEmailConfigured()
if (!configured) { if (!configured) {
ctx.throw(400, "Please contact your platform administrator, SMTP is not configured.") ctx.throw(
400,
"Please contact your platform administrator, SMTP is not configured."
)
} }
try { try {
const user = await getGlobalUserByEmail(email) const user = await getGlobalUserByEmail(email)

View File

@ -132,7 +132,7 @@ exports.invite = async ctx => {
} }
await sendEmail(email, EmailTemplatePurpose.INVITATION) await sendEmail(email, EmailTemplatePurpose.INVITATION)
ctx.body = { ctx.body = {
message: "Invitation has been sent." message: "Invitation has been sent.",
} }
} }

View File

@ -31,7 +31,11 @@ function buildResetUpdateValidation() {
router router
.post("/api/admin/auth", buildAuthValidation(), authController.authenticate) .post("/api/admin/auth", buildAuthValidation(), authController.authenticate)
.post("/api/admin/auth/reset", buildResetValidation(), authController.reset) .post("/api/admin/auth/reset", buildResetValidation(), authController.reset)
.post("/api/admin/auth/reset/update", buildResetUpdateValidation(), authController.resetUpdate) .post(
"/api/admin/auth/reset/update",
buildResetUpdateValidation(),
authController.resetUpdate
)
.post("/api/admin/auth/logout", authController.logout) .post("/api/admin/auth/logout", authController.logout)
.get("/api/admin/auth/google", authController.googlePreAuth) .get("/api/admin/auth/google", authController.googlePreAuth)
.get("/api/admin/auth/google/callback", authController.googleAuth) .get("/api/admin/auth/google/callback", authController.googleAuth)

View File

@ -46,6 +46,10 @@ router
.delete("/api/admin/users/:id", controller.destroy) .delete("/api/admin/users/:id", controller.destroy)
.get("/api/admin/users/:id", controller.find) .get("/api/admin/users/:id", controller.find)
.post("/api/admin/users/invite", buildInviteValidation(), controller.invite) .post("/api/admin/users/invite", buildInviteValidation(), controller.invite)
.post("/api/admin/users/invite/accept", buildInviteAcceptValidation(), controller.inviteAccept) .post(
"/api/admin/users/invite/accept",
buildInviteAcceptValidation(),
controller.inviteAccept
)
module.exports = router module.exports = router