Skip to content

feat: password changed email notification - #2176

Merged
fadymak merged 3 commits into
masterfrom
iat/password-changed-notification
Sep 23, 2025
Merged

fadymak merged 3 commits into
masterfrom
iat/password-changed-notification

Conversation

@fadymak

@fadymak fadymak commented Sep 22, 2025 •

Copy link
Copy Markdown
Contributor

This PR adds support for sending the user an email notification when their password has been changed.

3 new environment variables are introduced:

  • GOTRUE_MAILER_SUBJECTS_PASSWORD_CHANGED_NOTIFICATION: Email subject to use for password changed notification.
  • GOTRUE_MAILER_TEMPLATES_PASSWORD_CHANGED_NOTIFICATION: The URL to specify a custom template.
  • GOTRUE_MAILER_NOTIFICATIONS_PASSWORD_CHANGED_ENABLED: whether the notification is enabled or not.

The feature is disabled by default. To enable it, the GOTRUE_MAILER_NOTIFICATIONS_PASSWORD_CHANGED_ENABLED environment variable must be set to true.

The default email will look as follows:

default

@snyk-io

snyk-io Bot commented Sep 22, 2025 •

Copy link
Copy Markdown

⛔ Snyk checks have failed. 3 issues have been found so far.

Icon Severity Issues
Critical 0
High 0
Medium 3
Low 0

⛔ code/snyk check is complete. 3 issues have been found. (View Details)

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@fadymak
fadymak force-pushed the iat/password-changed-notification branch from 0097d53 to 04f3674 Compare September 23, 2025 08:02
@coveralls

coveralls commented Sep 23, 2025 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 17946359475

Details

  • 42 of 107 (39.25%) changed or added relevant lines in 5 files are covered.
  • 11 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.2%) to 67.7%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/api/user.go 2 5 40.0%
internal/api/mail.go 5 11 45.45%
internal/mailer/templatemailer/templatemailer.go 0 8 0.0%
internal/mailer/mockclient/mockclient.go 33 81 40.74%
Files with Coverage Reduction New Missed Lines %
internal/mailer/templatemailer/template.go 2 49.48%
internal/mailer/templatemailer/templatemailer.go 9 83.6%
Totals Coverage Status
Change from base Build 17946278066: -0.2%
Covered Lines: 12995
Relevant Lines: 19195

💛 - Coveralls

@fadymak
fadymak force-pushed the iat/password-changed-notification branch from 04f3674 to 7f81774 Compare September 23, 2025 08:53
@fadymak
fadymak marked this pull request as ready for review September 23, 2025 09:03
@fadymak
fadymak requested a review from a team as a code owner September 23, 2025 09:03

@hf hf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM! 🚢

@fadymak
fadymak merged commit fe0fd04 into master Sep 23, 2025
@fadymak
fadymak deleted the iat/password-changed-notification branch September 23, 2025 12:44
cemalkilic pushed a commit that referenced this pull request Sep 23, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.180.0](v2.179.0...v2.180.0)
(2025-09-23)


### Features

* add OAuth client type
([#2152](#2152))
([b118f1f](b118f1f))
* add phone to sms webhook payload
([#2160](#2160))
([d475ac1](d475ac1))
* background template reloading p1 - baseline decomposition
([#2148](#2148))
([746c937](746c937))
* config reloading with fsnotify, poller fallback, and signals
([#2161](#2161))
([c77d512](c77d512))
* enhance issuer URL validation in OAuth server metadata
([#2164](#2164))
([a9424d2](a9424d2))
* implement OAuth2 authorization endpoint
([#2107](#2107))
([5318552](5318552))
* **oauth2:** add `/oauth/token` endpoint
([#2159](#2159))
([a89a0b0](a89a0b0))
* **oauth2:** add admin endpoint to regenerate OAuth client secrets
([#2170](#2170))
([0bd1c28](0bd1c28))
* **oauth2:** return redirect_uri on GET authorization
([#2175](#2175))
([b0a0c3e](b0a0c3e))
* **oauth2:** use `id` field as the public client_id
([#2154](#2154))
([86b7de4](86b7de4))
* **openapi:** add OAuth 2.1 server endpoints and clarify OAuth modes
([#2165](#2165))
([1f804a2](1f804a2))
* password changed email notification
([#2176](#2176))
([fe0fd04](fe0fd04))
* support `transfer_sub` in apple id tokens
([#2162](#2162))
([8a71006](8a71006))


### Bug Fixes

* ensure request context exists in API db operations
([#2171](#2171))
([060a992](060a992))
* **makefile:** remove invalid @ symbol from shell commands
([#2168](#2168))
([e6afe45](e6afe45))
* **oauth2:** switch to Origin header for request validation
([#2174](#2174))
([42bc9ab](42bc9ab))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
fadymak added a commit that referenced this pull request Sep 30, 2025
This PR adds support for sending the user an email notification when
their password has been changed.

3 new environment variables are introduced:

- `GOTRUE_MAILER_SUBJECTS_PASSWORD_CHANGED_NOTIFICATION`: Email subject
to use for password changed notification.
- `GOTRUE_MAILER_TEMPLATES_PASSWORD_CHANGED_NOTIFICATION`: The URL to
specify a custom template.
-
`GOTRUE_MAILER_NOTIFICATION_CONFIGURATIONS_PASSWORD_CHANGED_NOTIFICATION_ENABLED`:
whether the notification is enabled or not.

The feature is disabled by default. To enable it, the
`GOTRUE_MAILER_NOTIFICATION_CONFIGURATIONS_PASSWORD_CHANGED_NOTIFICATION_ENABLED`
environment variable must be set to `true`.

The default email will look as follows:

<img width="828" height="472" alt="default"
src="https://github.com/user-attachments/assets/70588e93-b8aa-4bb9-82d9-b9e898aa7035"
/>
fadymak pushed a commit that referenced this pull request Sep 30, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.180.0](v2.179.0...v2.180.0)
(2025-09-23)


### Features

* add OAuth client type
([#2152](#2152))
([b118f1f](b118f1f))
* add phone to sms webhook payload
([#2160](#2160))
([d475ac1](d475ac1))
* background template reloading p1 - baseline decomposition
([#2148](#2148))
([746c937](746c937))
* config reloading with fsnotify, poller fallback, and signals
([#2161](#2161))
([c77d512](c77d512))
* enhance issuer URL validation in OAuth server metadata
([#2164](#2164))
([a9424d2](a9424d2))
* implement OAuth2 authorization endpoint
([#2107](#2107))
([5318552](5318552))
* **oauth2:** add `/oauth/token` endpoint
([#2159](#2159))
([a89a0b0](a89a0b0))
* **oauth2:** add admin endpoint to regenerate OAuth client secrets
([#2170](#2170))
([0bd1c28](0bd1c28))
* **oauth2:** return redirect_uri on GET authorization
([#2175](#2175))
([b0a0c3e](b0a0c3e))
* **oauth2:** use `id` field as the public client_id
([#2154](#2154))
([86b7de4](86b7de4))
* **openapi:** add OAuth 2.1 server endpoints and clarify OAuth modes
([#2165](#2165))
([1f804a2](1f804a2))
* password changed email notification
([#2176](#2176))
([fe0fd04](fe0fd04))
* support `transfer_sub` in apple id tokens
([#2162](#2162))
([8a71006](8a71006))


### Bug Fixes

* ensure request context exists in API db operations
([#2171](#2171))
([060a992](060a992))
* **makefile:** remove invalid @ symbol from shell commands
([#2168](#2168))
([e6afe45](e6afe45))
* **oauth2:** switch to Origin header for request validation
([#2174](#2174))
([42bc9ab](42bc9ab))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants