# HG changeset patch # User Kim Alvefur # Date 1691104261 -7200 # Node ID 9aace51c36374ee5c5ff0c0cb19386c5ec368232 # Parent 3a5cf8d80089972adb5c67f9d78fea1ff894e639 mod_http_oauth2: Bail on invalid or expired device flow state token diff -r 3a5cf8d80089 -r 9aace51c3637 mod_http_oauth2/mod_http_oauth2.lua --- a/mod_http_oauth2/mod_http_oauth2.lua Mon Jul 31 07:28:09 2023 +0200 +++ b/mod_http_oauth2/mod_http_oauth2.lua Fri Aug 04 01:11:01 2023 +0200 @@ -400,6 +400,8 @@ if is_device then -- reconstruct the device_code code = b64url(hashes.hmac_sha256(verification_key, device_state.user_code)); + else + return oauth_error("invalid_request"); end end local ok = codes:set("authorization_code:" .. params.client_id .. "#" .. code, {