fn device_authentication_matches( grant: &DeviceGrant, user_id: &UserId, idp_id: Option<&str>, ) -> bool