comparison mod_http_oauth2/mod_http_oauth2.lua @ 5273:40be37652d70

mod_http_oauth2: Fix traceback on missing 'scope' parameter parse_scopes() takes a string and it is not optional
author Kim Alvefur <zash@zash.se>
date Fri, 24 Mar 2023 00:07:58 +0100
parents 3a1df3adad0c
children 67777cb7353d
comparison
equal deleted inserted replaced
5272:acab61ba7f02 5273:40be37652d70
525 if not auth_state.user then 525 if not auth_state.user then
526 -- Render login page 526 -- Render login page
527 return render_page(templates.login, { state = auth_state, client = client }); 527 return render_page(templates.login, { state = auth_state, client = client });
528 elseif auth_state.consent == nil then 528 elseif auth_state.consent == nil then
529 -- Render consent page 529 -- Render consent page
530 return render_page(templates.consent, { state = auth_state; client = client; scopes = parse_scopes(params.scope) }, true); 530 return render_page(templates.consent, { state = auth_state; client = client; scopes = parse_scopes(params.scope or "") }, true);
531 elseif not auth_state.consent then 531 elseif not auth_state.consent then
532 -- Notify client of rejection 532 -- Notify client of rejection
533 return error_response(request, oauth_error("access_denied")); 533 return error_response(request, oauth_error("access_denied"));
534 end 534 end
535 -- else auth_state.consent == true 535 -- else auth_state.consent == true