# jbrada/module-well-known-change-password

> This Magento 2 module provides a well-known endpoint for the 'change password' functionality, allowing seamless redirection to the customer password change page.

`composer require jbrada/module-well-known-change-password`

Canonical URL: https://packagento.com/jbrada/module-well-known-change-password

## At a glance

- **Vendor**: jbrada (https://packagento.com/jbrada.md)
- **Latest version**: 0.0.6 — released 2024-10-15
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/jbrada/module-well-known-change-password and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require jbrada/module-well-known-change-password:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

This Magento 2 module provides a well-known endpoint for the 'change password' functionality, allowing seamless redirection to the customer password change page.

## README

![Code Analysis](https://github.com/jbrada/module-well-known-change-password/actions/workflows/code-analysis.yml/badge.svg)
![Tests](https://github.com/jbrada/module-well-known-change-password/actions/workflows/tests.yml/badge.svg)

### Overview

The `JBrada_WellKnownChangePassword` module implements the [`.well-known/change-password`](https://wicg.github.io/change-password-url/) standard for Magento 2. This allows password managers to easily locate and redirect users to the correct URL when they wish to change their password.

While there are multiple ways to achieve this functionality, such as adding custom URL rewrites in Magento or configuring the webserver, this method directly integrates it within Magento itself. By doing so, the URL is permanently tied into Magento, eliminating the need for further configuration or maintenance.

The module creates a well-known URL `/.well-known/change-password` that redirects to the Magento customer edit page, where users can manage their account and update their password.

### Installation

To install the module via composer, run the following command:

```bash
composer require jbrada/module-well-known-change-password
```

Enable the module in Magento:

```bash
bin/magento module:enable JBrada_WellKnownChangePassword
bin/magento setup:upgrade
```

### Usage

Once installed, the module automatically exposes the `/.well-known/change-password` URL on your Magento site. When visited, this URL will redirect to the customer password change page where users can manage their password.

#### Example

If your Magento store URL is `https://example.com`, visiting:

```
https://example.com/.well-known/change-password
```

will redirect to:

```
https://example.com/customer/account/edit/changepass/1/
```

### Tools Implementing This Standard

This standard is already supported by a number of tools, including:

- iCloud Keychain (iOS 12)
- Safari 12
- 1Password (1Password 8, and 1Password for Chrome, Firefox, Edge, and macOS Safari)
- Chrome 86
- Backdrop CMS (via the Well-known module)

### License

This module is licensed under MIT license. Please refer to the `LICENSE.md` file for more information.

### Note on Testing

This repository utilizes [ExtDN's GitHub Actions for Magento 2](https://github.com/extdn/github-actions-m2) to run tests in GitHub Actions.

### About

This project is created by [Jiří Brada](https://jbrada.cz) and is a non-profit initiative to support the Magento community. 

Have feedback? I'd love to [hear from you](mailto:jiri@jbrada.cz).

Connect with me on [LinkedIn](https://www.linkedin.com/in/jbrada) or visit my [website](https://jbrada.cz).

## Recent Versions

| Version | Released |
|---|---|
| 0.0.6 | 2024-10-15 |
| 0.0.5 | 2024-10-15 |
| 0.0.4 | 2024-10-15 |
| 0.0.3 | 2024-10-15 |
| 0.0.2 | 2024-10-15 |
| 0.0.1 | 2024-10-14 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | ^103.0 |
| magento/module-store | ^101.1 |
| php | ^8.1 |
| psr/log | ^1.0.1 \|\| ^2.0 \|\| ^3.0 |

### Require (dev)

| Package | Constraint |
|---|---|
| bitexpert/phpstan-magento | ^0.32.0 |
| dealerdirect/phpcodesniffer-composer-installer | ^0.7 \|\| ^1.0 |
| magento/magento-coding-standard | * |
| phpstan/phpstan | ~1.7 |
| phpunit/phpunit | ^9.5 |

## Quality

Latest release (0.0.6) passes the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Pass | 0 |  |
| PHPMD | Pass | 0 |  |
| Cpd | Pass | 0 |  |
| Composer validate | Pass | 0 |  |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["jbrada/module-well-known-change-password"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

jbrada is a Magento 2 vendor on Packagento. See https://packagento.com/jbrada.md for their full catalogue.

