Add support for login intercept messages and announcements

This commit is contained in:
garrettmills
2020-08-12 22:07:53 -05:00
parent 9a35bd60e1
commit f1bd6e1ad4
6 changed files with 99 additions and 1 deletions

View File

@@ -605,6 +605,13 @@ class AuthController extends Controller {
// Create a login tracking activity
await this.activity.login(req)
// If there are login messages, show those
const LoginMessage = this.models.get('LoginMessage')
const messages = await LoginMessage.for_user(user)
if ( messages.length > 0 ) {
await req.trap.begin('login_message', { session_only: true })
}
return res.api({
success: true,
session_created: !!req.body.create_session,