Software / code / prosody-modules
Comparison
mod_http_oauth2/mod_http_oauth2.lua @ 6318:fe797da37174
mod_http_oauth2: Use cheaper array member check
This one does not create two new tables and then throw them away.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 02 Jul 2025 15:55:05 +0200 |
| parent | 6317:8108aec64fb9 |
| child | 6319:63ef69b2f046 |
comparison
equal
deleted
inserted
replaced
| 6317:8108aec64fb9 | 6318:fe797da37174 |
|---|---|
| 1086 | 1086 |
| 1087 if not client then | 1087 if not client then |
| 1088 return render_error(oauth_error("invalid_request", "Invalid 'client_id' parameter")); | 1088 return render_error(oauth_error("invalid_request", "Invalid 'client_id' parameter")); |
| 1089 end | 1089 end |
| 1090 | 1090 |
| 1091 if not set.new(client.grant_types):contains(device_uri) then | 1091 if not array_contains(client.grant_types, device_uri) then |
| 1092 return render_error(oauth_error("invalid_client", "Client not registered for device authorization grant")); | 1092 return render_error(oauth_error("invalid_client", "Client not registered for device authorization grant")); |
| 1093 end | 1093 end |
| 1094 | 1094 |
| 1095 local requested_scopes = parse_scopes(params.scope or ""); | 1095 local requested_scopes = parse_scopes(params.scope or ""); |
| 1096 if client.scope then | 1096 if client.scope then |