Skip to main content

Module student_number_verification_tokens

Module student_number_verification_tokens 

Source

Structs§

NewStudentNumberVerificationToken
SeedStudentNumberVerificationToken
A token row with everything pinned, for the seed only.
StudentNumberVerificationToken

Constants§

TOKEN_LENGTH 🔒
Length of a linking token, which is the only proof of ownership and is bound to no account.

Functions§

claim
Marks the token claimed by the account. Returns false if another claim already won the race.
get_by_id
get_unclaimed_by_token
Looks up an unused, unexpired token without claiming it; claiming is a separate explicit POST.
insert
Mints a token for a Sisu person, bound to no account: the click while logged in creates the binding. Returns the row id and the plaintext token for the mailed link.
insert_seed_row
Seeds a token with a fixed plaintext value and a chosen expiry/claim state, which insert cannot do: system tests need the valid, expired and used links to be constants. Seed use only.
is_valid
maybe_cleanup_expired
Probabilistic cleanup instead of a cron.
soft_delete_unused_for_student_number
Retires outstanding tokens for a student number, once the link was established some other way.