fix: Show error message when signing in to suspended account

closes #1056
This commit is contained in:
Tom Moor
2019-10-12 19:16:17 -07:00
parent fc201663c6
commit ec4d4fb20f
4 changed files with 13 additions and 3 deletions

View File

@ -81,7 +81,11 @@ export default function auth(options?: { required?: boolean } = {}) {
ctx.cache[user.id] = user;
}
ctx.signIn = (user, team, service, isFirstSignin = false) => {
ctx.signIn = async (user, team, service, isFirstSignin = false) => {
if (user.isSuspended) {
return ctx.redirect('/?notice=suspended');
}
// update the database when the user last signed in
user.updateSignedIn(ctx.request.ip);