Skip to main content

process_device_code_grant

Function process_device_code_grant 

Source
async fn process_device_code_grant(
    conn: &mut PgConnection,
    request: &TokenGrantRequest<'_>,
    device_code: &SecretString,
) -> Result<TokenGrantResult, TokenGrantError>
Expand description

Handle the RFC 8628 device-code grant at the token endpoint.

The poll is recorded on the bare connection so last_polled_at persists regardless of the outcome (a pending / slow_down response must still advance the poll clock). Only the approved branch opens a transaction, which atomically consumes the single-use device code and reuses the authorization-code issuance path so access/refresh creation and scope persistence stay identical across grants.