Skip to main content

reissue

Function reissue 

Source
pub async fn reissue<'e, E>(
    ex: E,
    id: i64,
    league_id: i64,
    token_hash: &str,
) -> Result<Option<String>, Error>
where E: Executor<'e, Database = Sqlite>,
Expand description

Mint a new secret onto an outstanding invite: replace its hash and restart the 14-day clock. Scoped to league_id and inert once accepted, like revoke. Returns the invite’s target email when a row matched — None means the invite is gone, accepted, or belongs to another league.

Backs “regenerate link”: the raw secret is unrecoverable after upsert, so a fresh link means a fresh secret, which retires any link sent earlier.

The expiry window is duplicated from upsert because sqlx macros need a literal query string; change both together.