Skip to content

feat(otp): add link_token_hash column to one_time_tokens table - #2800

Open
annabkr wants to merge 1 commit into
masterfrom
annabaker/auth-1556-add-link_token_hash-column
Open

feat(otp): add link_token_hash column to one_time_tokens table#2800
annabkr wants to merge 1 commit into
masterfrom
annabaker/auth-1556-add-link_token_hash-column

Conversation

@annabkr

@annabkr annabkr commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Feature

What is the current behavior?

Token hashes are stored in the token_hash column and tightly coupled to the low-entropy OTP code.

What is the new behavior?

There is a new column link_token_hash which will be used to store a high-entropy token hash for user flows that don't require typing in a code.

Additional context

Closes AUTH-1556.

@annabkr
annabkr marked this pull request as ready for review September 11, 2026 20:46
@annabkr
annabkr requested a review from a team as a code owner September 11, 2026 20:46
begin
create index if not exists one_time_tokens_link_token_hash_hash_idx on {{ index .Options "Namespace" }}.one_time_tokens using hash (link_token_hash);
exception when others then
-- Fallback to a btree index if hash creation fails

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is what we do for the token_hash and that choice seemed to be grounded in OrioleDB support.

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.

1 participant