added suspending admin email to error screen

This commit is contained in:
Jori Lallo
2018-03-06 23:38:52 -08:00
parent e9e4538436
commit f5c1ddf8b9
7 changed files with 37 additions and 22 deletions

View File

@ -76,7 +76,8 @@ export default function auth() {
}
if (user.isSuspended) {
throw new UserSuspendedError();
const suspendingAdmin = await User.findById(user.suspendedById);
throw new UserSuspendedError({ adminEmail: suspendingAdmin.email });
}
ctx.state.token = token;