Repository navigation
fix: enforce uniqueness on verified phone numbers - #1693
Merged
Merged
Conversation
Pull Request Test Coverage Report for Build 10246916294Details
💛 - Coveralls |
J0
commented
Jul 31, 2024
kangmingtay
reviewed
Jul 31, 2024
J0
commented
Aug 2, 2024
J0
force-pushed
the
j0/allow_only_one_phone_factor
branch
from
August 3, 2024 10:17
3405e53 to
d6e0bca
Compare
J0
commented
Aug 3, 2024
J0
force-pushed
the
j0/allow_only_one_phone_factor
branch
from
August 4, 2024 20:33
baef1a4 to
8a6a489
Compare
J0
commented
Aug 4, 2024
J0
commented
Aug 4, 2024
J0
marked this pull request as ready for review
August 4, 2024 22:40
J0
commented
Aug 4, 2024
hf
approved these changes
Aug 5, 2024
hf
left a comment
Contributor
There was a problem hiding this comment.
Seems OK except for the limitation about enrolling multiple phone numbers.
J0
added a commit
that referenced
this pull request
Aug 5, 2024
## What kind of change does this PR introduce? Deprecates `sent_at` on Challenge in favour of the `last_challenged_at` field on factors. We use this to calculate whether it's appropriate to allow for more SMS-es to be sent. Base is pointed to #1693 as it depends on the PR and diffs are smaller when pointed against #1693
J0
pushed a commit
that referenced
this pull request
Aug 5, 2024
🤖 I have created a release *beep* *boop* --- ## [2.158.1](v2.158.0...v2.158.1) (2024-08-05) ### Bug Fixes * add last_challenged_at field to mfa factors ([#1705](#1705)) ([29cbeb7](29cbeb7)) * allow enabling sms hook without setting up sms provider ([#1704](#1704)) ([575e88a](575e88a)) * drop the MFA_ENABLED config ([#1701](#1701)) ([078c3a8](078c3a8)) * enforce uniqueness on verified phone numbers ([#1693](#1693)) ([70446cc](70446cc)) * expose `X-Supabase-Api-Version` header in CORS ([#1612](#1612)) ([6ccd814](6ccd814)) * include factor_id in query ([#1702](#1702)) ([ac14e82](ac14e82)) * move is owned by check to load factor ([#1703](#1703)) ([701a779](701a779)) * refactor TOTP MFA into separate methods ([#1698](#1698)) ([250d92f](250d92f)) * remove check for content-length ([#1700](#1700)) ([81b332d](81b332d)) * remove FindFactorsByUser ([#1707](#1707)) ([af8e2dd](af8e2dd)) * update openapi spec for MFA (Phone) ([#1689](#1689)) ([a3da4b8](a3da4b8)) --- 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>
uxodb
pushed a commit
to uxodb/auth
that referenced
this pull request
Nov 13, 2024
## What kind of change does this PR introduce? With this change: - Multiple verified phone mfa factors can exist so long as they have distinct phone numbers (see discussion below) - Enrolling a factor with a number that is the same as the existing verified factor will result in a 422 status code - Enrolling a factor with a number that is the same as another existing unverified factor will result in the deletion of the older factor. Also includes: - A refactor to check for duplicate constraints at application level then at the Postgres layer. - A narrowing of deletion so that only unverified factors of the same type are deleted upon first successful verification Follow up to supabase#1687 to support the unique constraint on phone factors.
uxodb
pushed a commit
to uxodb/auth
that referenced
this pull request
Nov 13, 2024
## What kind of change does this PR introduce? Deprecates `sent_at` on Challenge in favour of the `last_challenged_at` field on factors. We use this to calculate whether it's appropriate to allow for more SMS-es to be sent. Base is pointed to supabase#1693 as it depends on the PR and diffs are smaller when pointed against supabase#1693
uxodb
pushed a commit
to uxodb/auth
that referenced
this pull request
Nov 13, 2024
🤖 I have created a release *beep* *boop* --- ## [2.158.1](supabase/auth@v2.158.0...v2.158.1) (2024-08-05) ### Bug Fixes * add last_challenged_at field to mfa factors ([supabase#1705](supabase#1705)) ([29cbeb7](supabase@29cbeb7)) * allow enabling sms hook without setting up sms provider ([supabase#1704](supabase#1704)) ([575e88a](supabase@575e88a)) * drop the MFA_ENABLED config ([supabase#1701](supabase#1701)) ([078c3a8](supabase@078c3a8)) * enforce uniqueness on verified phone numbers ([supabase#1693](supabase#1693)) ([70446cc](supabase@70446cc)) * expose `X-Supabase-Api-Version` header in CORS ([supabase#1612](supabase#1612)) ([6ccd814](supabase@6ccd814)) * include factor_id in query ([supabase#1702](supabase#1702)) ([ac14e82](supabase@ac14e82)) * move is owned by check to load factor ([supabase#1703](supabase#1703)) ([701a779](supabase@701a779)) * refactor TOTP MFA into separate methods ([supabase#1698](supabase#1698)) ([250d92f](supabase@250d92f)) * remove check for content-length ([supabase#1700](supabase#1700)) ([81b332d](supabase@81b332d)) * remove FindFactorsByUser ([supabase#1707](supabase#1707)) ([af8e2dd](supabase@af8e2dd)) * update openapi spec for MFA (Phone) ([supabase#1689](supabase#1689)) ([a3da4b8](supabase@a3da4b8)) --- 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>
LashaJini
pushed a commit
to LashaJini/auth
that referenced
this pull request
Nov 13, 2024
## What kind of change does this PR introduce? With this change: - Multiple verified phone mfa factors can exist so long as they have distinct phone numbers (see discussion below) - Enrolling a factor with a number that is the same as the existing verified factor will result in a 422 status code - Enrolling a factor with a number that is the same as another existing unverified factor will result in the deletion of the older factor. Also includes: - A refactor to check for duplicate constraints at application level then at the Postgres layer. - A narrowing of deletion so that only unverified factors of the same type are deleted upon first successful verification Follow up to supabase#1687 to support the unique constraint on phone factors.
LashaJini
pushed a commit
to LashaJini/auth
that referenced
this pull request
Nov 13, 2024
## What kind of change does this PR introduce? Deprecates `sent_at` on Challenge in favour of the `last_challenged_at` field on factors. We use this to calculate whether it's appropriate to allow for more SMS-es to be sent. Base is pointed to supabase#1693 as it depends on the PR and diffs are smaller when pointed against supabase#1693
LashaJini
pushed a commit
to LashaJini/auth
that referenced
this pull request
Nov 13, 2024
🤖 I have created a release *beep* *boop* --- ## [2.158.1](supabase/auth@v2.158.0...v2.158.1) (2024-08-05) ### Bug Fixes * add last_challenged_at field to mfa factors ([supabase#1705](supabase#1705)) ([29cbeb7](supabase@29cbeb7)) * allow enabling sms hook without setting up sms provider ([supabase#1704](supabase#1704)) ([575e88a](supabase@575e88a)) * drop the MFA_ENABLED config ([supabase#1701](supabase#1701)) ([078c3a8](supabase@078c3a8)) * enforce uniqueness on verified phone numbers ([supabase#1693](supabase#1693)) ([70446cc](supabase@70446cc)) * expose `X-Supabase-Api-Version` header in CORS ([supabase#1612](supabase#1612)) ([6ccd814](supabase@6ccd814)) * include factor_id in query ([supabase#1702](supabase#1702)) ([ac14e82](supabase@ac14e82)) * move is owned by check to load factor ([supabase#1703](supabase#1703)) ([701a779](supabase@701a779)) * refactor TOTP MFA into separate methods ([supabase#1698](supabase#1698)) ([250d92f](supabase@250d92f)) * remove check for content-length ([supabase#1700](supabase#1700)) ([81b332d](supabase@81b332d)) * remove FindFactorsByUser ([supabase#1707](supabase#1707)) ([af8e2dd](supabase@af8e2dd)) * update openapi spec for MFA (Phone) ([supabase#1689](supabase#1689)) ([a3da4b8](supabase@a3da4b8)) --- 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>
LashaJini
pushed a commit
to LashaJini/auth
that referenced
this pull request
Nov 15, 2024
## What kind of change does this PR introduce? With this change: - Multiple verified phone mfa factors can exist so long as they have distinct phone numbers (see discussion below) - Enrolling a factor with a number that is the same as the existing verified factor will result in a 422 status code - Enrolling a factor with a number that is the same as another existing unverified factor will result in the deletion of the older factor. Also includes: - A refactor to check for duplicate constraints at application level then at the Postgres layer. - A narrowing of deletion so that only unverified factors of the same type are deleted upon first successful verification Follow up to supabase#1687 to support the unique constraint on phone factors.
LashaJini
pushed a commit
to LashaJini/auth
that referenced
this pull request
Nov 15, 2024
## What kind of change does this PR introduce? Deprecates `sent_at` on Challenge in favour of the `last_challenged_at` field on factors. We use this to calculate whether it's appropriate to allow for more SMS-es to be sent. Base is pointed to supabase#1693 as it depends on the PR and diffs are smaller when pointed against supabase#1693
LashaJini
pushed a commit
to LashaJini/auth
that referenced
this pull request
Nov 15, 2024
🤖 I have created a release *beep* *boop* --- ## [2.158.1](supabase/auth@v2.158.0...v2.158.1) (2024-08-05) ### Bug Fixes * add last_challenged_at field to mfa factors ([supabase#1705](supabase#1705)) ([29cbeb7](supabase@29cbeb7)) * allow enabling sms hook without setting up sms provider ([supabase#1704](supabase#1704)) ([575e88a](supabase@575e88a)) * drop the MFA_ENABLED config ([supabase#1701](supabase#1701)) ([078c3a8](supabase@078c3a8)) * enforce uniqueness on verified phone numbers ([supabase#1693](supabase#1693)) ([70446cc](supabase@70446cc)) * expose `X-Supabase-Api-Version` header in CORS ([supabase#1612](supabase#1612)) ([6ccd814](supabase@6ccd814)) * include factor_id in query ([supabase#1702](supabase#1702)) ([ac14e82](supabase@ac14e82)) * move is owned by check to load factor ([supabase#1703](supabase#1703)) ([701a779](supabase@701a779)) * refactor TOTP MFA into separate methods ([supabase#1698](supabase#1698)) ([250d92f](supabase@250d92f)) * remove check for content-length ([supabase#1700](supabase#1700)) ([81b332d](supabase@81b332d)) * remove FindFactorsByUser ([supabase#1707](supabase#1707)) ([af8e2dd](supabase@af8e2dd)) * update openapi spec for MFA (Phone) ([supabase#1689](supabase#1689)) ([a3da4b8](supabase@a3da4b8)) --- 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>
cemalkilic
pushed a commit
that referenced
this pull request
Aug 7, 2025
## What kind of change does this PR introduce? With this change: - Multiple verified phone mfa factors can exist so long as they have distinct phone numbers (see discussion below) - Enrolling a factor with a number that is the same as the existing verified factor will result in a 422 status code - Enrolling a factor with a number that is the same as another existing unverified factor will result in the deletion of the older factor. Also includes: - A refactor to check for duplicate constraints at application level then at the Postgres layer. - A narrowing of deletion so that only unverified factors of the same type are deleted upon first successful verification Follow up to #1687 to support the unique constraint on phone factors.
cemalkilic
pushed a commit
that referenced
this pull request
Aug 7, 2025
## What kind of change does this PR introduce? Deprecates `sent_at` on Challenge in favour of the `last_challenged_at` field on factors. We use this to calculate whether it's appropriate to allow for more SMS-es to be sent. Base is pointed to #1693 as it depends on the PR and diffs are smaller when pointed against #1693
cemalkilic
pushed a commit
that referenced
this pull request
Aug 7, 2025
🤖 I have created a release *beep* *boop* --- ## [2.158.1](v2.158.0...v2.158.1) (2024-08-05) ### Bug Fixes * add last_challenged_at field to mfa factors ([#1705](#1705)) ([29cbeb7](29cbeb7)) * allow enabling sms hook without setting up sms provider ([#1704](#1704)) ([575e88a](575e88a)) * drop the MFA_ENABLED config ([#1701](#1701)) ([078c3a8](078c3a8)) * enforce uniqueness on verified phone numbers ([#1693](#1693)) ([70446cc](70446cc)) * expose `X-Supabase-Api-Version` header in CORS ([#1612](#1612)) ([6ccd814](6ccd814)) * include factor_id in query ([#1702](#1702)) ([ac14e82](ac14e82)) * move is owned by check to load factor ([#1703](#1703)) ([701a779](701a779)) * refactor TOTP MFA into separate methods ([#1698](#1698)) ([250d92f](250d92f)) * remove check for content-length ([#1700](#1700)) ([81b332d](81b332d)) * remove FindFactorsByUser ([#1707](#1707)) ([af8e2dd](af8e2dd)) * update openapi spec for MFA (Phone) ([#1689](#1689)) ([a3da4b8](a3da4b8)) --- 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>
xeladotbe
pushed a commit
to xeladotbe/supabase-auth
that referenced
this pull request
Sep 27, 2025
## What kind of change does this PR introduce? With this change: - Multiple verified phone mfa factors can exist so long as they have distinct phone numbers (see discussion below) - Enrolling a factor with a number that is the same as the existing verified factor will result in a 422 status code - Enrolling a factor with a number that is the same as another existing unverified factor will result in the deletion of the older factor. Also includes: - A refactor to check for duplicate constraints at application level then at the Postgres layer. - A narrowing of deletion so that only unverified factors of the same type are deleted upon first successful verification Follow up to supabase#1687 to support the unique constraint on phone factors.
xeladotbe
pushed a commit
to xeladotbe/supabase-auth
that referenced
this pull request
Sep 27, 2025
## What kind of change does this PR introduce? Deprecates `sent_at` on Challenge in favour of the `last_challenged_at` field on factors. We use this to calculate whether it's appropriate to allow for more SMS-es to be sent. Base is pointed to supabase#1693 as it depends on the PR and diffs are smaller when pointed against supabase#1693
xeladotbe
pushed a commit
to xeladotbe/supabase-auth
that referenced
this pull request
Sep 27, 2025
🤖 I have created a release *beep* *boop* --- ## [2.158.1](supabase/auth@v2.158.0...v2.158.1) (2024-08-05) ### Bug Fixes * add last_challenged_at field to mfa factors ([supabase#1705](supabase#1705)) ([29cbeb7](supabase@29cbeb7)) * allow enabling sms hook without setting up sms provider ([supabase#1704](supabase#1704)) ([575e88a](supabase@575e88a)) * drop the MFA_ENABLED config ([supabase#1701](supabase#1701)) ([078c3a8](supabase@078c3a8)) * enforce uniqueness on verified phone numbers ([supabase#1693](supabase#1693)) ([70446cc](supabase@70446cc)) * expose `X-Supabase-Api-Version` header in CORS ([supabase#1612](supabase#1612)) ([6ccd814](supabase@6ccd814)) * include factor_id in query ([supabase#1702](supabase#1702)) ([ac14e82](supabase@ac14e82)) * move is owned by check to load factor ([supabase#1703](supabase#1703)) ([701a779](supabase@701a779)) * refactor TOTP MFA into separate methods ([supabase#1698](supabase#1698)) ([250d92f](supabase@250d92f)) * remove check for content-length ([supabase#1700](supabase#1700)) ([81b332d](supabase@81b332d)) * remove FindFactorsByUser ([supabase#1707](supabase#1707)) ([af8e2dd](supabase@af8e2dd)) * update openapi spec for MFA (Phone) ([supabase#1689](supabase#1689)) ([a3da4b8](supabase@a3da4b8)) --- 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
pushed a commit
that referenced
this pull request
Sep 30, 2025
## What kind of change does this PR introduce? With this change: - Multiple verified phone mfa factors can exist so long as they have distinct phone numbers (see discussion below) - Enrolling a factor with a number that is the same as the existing verified factor will result in a 422 status code - Enrolling a factor with a number that is the same as another existing unverified factor will result in the deletion of the older factor. Also includes: - A refactor to check for duplicate constraints at application level then at the Postgres layer. - A narrowing of deletion so that only unverified factors of the same type are deleted upon first successful verification Follow up to #1687 to support the unique constraint on phone factors.
fadymak
pushed a commit
that referenced
this pull request
Sep 30, 2025
## What kind of change does this PR introduce? Deprecates `sent_at` on Challenge in favour of the `last_challenged_at` field on factors. We use this to calculate whether it's appropriate to allow for more SMS-es to be sent. Base is pointed to #1693 as it depends on the PR and diffs are smaller when pointed against #1693
fadymak
pushed a commit
that referenced
this pull request
Sep 30, 2025
🤖 I have created a release *beep* *boop* --- ## [2.158.1](v2.158.0...v2.158.1) (2024-08-05) ### Bug Fixes * add last_challenged_at field to mfa factors ([#1705](#1705)) ([29cbeb7](29cbeb7)) * allow enabling sms hook without setting up sms provider ([#1704](#1704)) ([575e88a](575e88a)) * drop the MFA_ENABLED config ([#1701](#1701)) ([078c3a8](078c3a8)) * enforce uniqueness on verified phone numbers ([#1693](#1693)) ([70446cc](70446cc)) * expose `X-Supabase-Api-Version` header in CORS ([#1612](#1612)) ([6ccd814](6ccd814)) * include factor_id in query ([#1702](#1702)) ([ac14e82](ac14e82)) * move is owned by check to load factor ([#1703](#1703)) ([701a779](701a779)) * refactor TOTP MFA into separate methods ([#1698](#1698)) ([250d92f](250d92f)) * remove check for content-length ([#1700](#1700)) ([81b332d](81b332d)) * remove FindFactorsByUser ([#1707](#1707)) ([af8e2dd](af8e2dd)) * update openapi spec for MFA (Phone) ([#1689](#1689)) ([a3da4b8](a3da4b8)) --- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
With this change:
Also includes:
Follow up to #1687 to support the unique constraint on phone factors.