comparison mod_http_oauth2/mod_http_oauth2.lua @ 5191:f5a58cbe86e4

mod_http_oauth2: Derive scope from correct user details Plausible copypaste mistake
author Kim Alvefur <zash@zash.se>
date Fri, 03 Mar 2023 18:00:28 +0100
parents 1733f184e2bb
children 03aa9baa9ac3
comparison
equal deleted inserted replaced
5190:1733f184e2bb 5191:f5a58cbe86e4
105 if err then error(err); end 105 if err then error(err); end
106 if not client then 106 if not client then
107 return oauth_error("invalid_client", "incorrect credentials"); 107 return oauth_error("invalid_client", "incorrect credentials");
108 end 108 end
109 109
110 local granted_scopes = filter_scopes(client_owner, client_host, params.scope); 110 local request_username, request_host = jid.split(granted_jid);
111 local granted_scopes = filter_scopes(request_username, request_host, params.scope);
111 112
112 local code = uuid.generate(); 113 local code = uuid.generate();
113 local ok = codes:set(params.client_id .. "#" .. code, { 114 local ok = codes:set(params.client_id .. "#" .. code, {
114 issued = os.time(); 115 issued = os.time();
115 granted_jid = granted_jid; 116 granted_jid = granted_jid;