Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vito Login Alert

A VitoDeploy 4.x plugin that sends an email whenever a user successfully logs in. It uses VitoDeploy's existing Laravel mail configuration, so no additional mail package or duplicate SMTP credentials are required.

Requirements

  • VitoDeploy 4.x
  • PHP 8.4
  • A working mailer configured in the VitoDeploy .env file

Installation

Install the plugin from the VitoDeploy dashboard:

  1. Open Admin → Plugins.
  2. Install the GitHub repository for this plugin, or place it at app/Vito/Plugins/Cp6/VitodeployLoginAlert for local development.
  3. Enable Login Alert.

The plugin validates that an alert recipient is available when it is installed or enabled.

Configuration

The plugin sends through VitoDeploy's standard MAIL_* configuration. For example:

MAIL_MAILER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_USERNAME=your-username
MAIL_PASSWORD=your-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=vito@example.com
MAIL_FROM_NAME="VitoDeploy"

Login alerts are delivered to MAIL_FROM_ADDRESS, using VitoDeploy's configured default mailer and sender name.

After changing .env, clear VitoDeploy's cached configuration:

php artisan optimize:clear

Behaviour

  • An email is sent only after Laravel reports a successful authentication.
  • Two-factor logins are reported after the second factor has succeeded, not when the password alone is accepted.
  • Alerts include the user's name and email address, the request IP address, login time, and browser user agent.
  • Failed password attempts do not generate alerts.
  • Mail delivery is synchronous, so it does not require a queue worker.
  • A mail transport failure is logged and does not prevent the user from logging in.
  • Disabling the plugin prevents the event listener from being registered on the next application request.

Troubleshooting

If a login succeeds but no alert arrives, inspect VitoDeploy's storage/logs/laravel.log for Unable to send the successful login alert email. The entry includes the configured mailer and recipient together with the exception class and message returned by the mail transport.

Tests

The feature suite is designed to run from a VitoDeploy 4.x checkout after this repository has been placed at app/Vito/Plugins/Cp6/VitodeployLoginAlert:

php artisan test app/Vito/Plugins/Cp6/VitodeployLoginAlert/tests/Feature/VitoLoginAlertTest.php

License

MIT

About

Email an alert when a user successfully logs in to VitoDeploy.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages