# Magento 2 Auth Redirect

Custom authentication redirect module for Magento 2. It provides controller endpoints and plugins to control customer login flow, including custom redirects and login attempt tracking.

## Features
- Redirect logic for customer authentication and account access.
- Login success and failure observers for tracking.
- Controllers for auth pages and ajax login endpoints.

## Requirements
- PHP >= 7.4
- Magento 2 (framework dependency via Composer)

## Installation
1. Add the repository in your root composer.json if this is a private package.
2. Require the module:

```bash
composer require portalpeople/authredirect
```

3. Enable the module and run setup:

```bash
bin/magento module:enable PortalPeople_AuthRedirect
bin/magento setup:upgrade
bin/magento cache:flush
```

## Configuration
Module configuration is provided via system configuration and DI settings. Review:
- src/etc/di.xml
- src/etc/frontend/di.xml
- src/etc/adminhtml/system.xml

## Usage
The module registers routes and templates under view/frontend. Routes are defined in:
- src/etc/frontend/routes.xml

Layout updates and templates are located in:
- src/view/frontend/layout
- src/view/frontend/templates

## Development
If you add new observers or plugins, run:

```bash
bin/magento cache:flush
bin/magento setup:di:compile
```

## License
MIT