comparison mod_http_oauth2/mod_http_oauth2.lua @ 5340:cd195283127f

mod_http_oauth2: Fix table index error when using refresh token
author Kim Alvefur <zash@zash.se>
date Wed, 12 Apr 2023 11:22:36 +0200
parents 8d8e85d6dc91
children dcb93ffe64ae
comparison
equal deleted inserted replaced
5339:6d99ddd99694 5340:cd195283127f
364 364
365 -- new_access_token() requires the actual token 365 -- new_access_token() requires the actual token
366 refresh_token_info.token = params.refresh_token; 366 refresh_token_info.token = params.refresh_token;
367 367
368 return json.encode(new_access_token( 368 return json.encode(new_access_token(
369 refresh_token_info.jid, refresh_token_info.role, refresh_token_info.data.oauth2_scopes, client, nil, refresh_token_info 369 refresh_token_info.jid, refresh_token_info.role, refresh_token_info.grant.data.oauth2_scopes, client, nil, refresh_token_info
370 )); 370 ));
371 end 371 end
372 372
373 -- Used to issue/verify short-lived tokens for the authorization process below 373 -- Used to issue/verify short-lived tokens for the authorization process below
374 local new_user_token, verify_user_token = jwt.init("HS256", random.bytes(32), nil, { default_ttl = 600 }); 374 local new_user_token, verify_user_token = jwt.init("HS256", random.bytes(32), nil, { default_ttl = 600 });