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_ids
The live tokens of these ids, keyed by id.
get_by_token_any_state
Looks up a token in any state, so the landing page can tell an expired link from a spent one.
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_batch
Batch form of insert: mints one token per row in a single INSERT, at the caller-chosen ids, in order. Each row still gets its own random plaintext token.
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.
soft_delete_expired
Retires tokens whose link has expired unused, oldest first.
soft_delete_unused_for_student_number
Retires outstanding tokens for a student number, once the link was established some other way.