Skip to main content

find_conflicting_account

Function find_conflicting_account 

Source
async fn find_conflicting_account(
    conn: &mut PgConnection,
    token: &StudentNumberVerificationToken,
    user_id: Uuid,
) -> Result<bool, ControllerError>
Expand description

Whether the token’s holder is already live on some other account of ours.

Both keys, because both are unique: a student who changed programme keeps their Sisu person id and gets a new number, so checking the number alone lets the claim through and then trips uq_verified_student_numbers_person — after the token has been spent, and as a bare 500.