Diff

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
parent 5271:3a1df3adad0c
child 5276:67777cb7353d
line wrap: on
line diff
--- a/mod_http_oauth2/mod_http_oauth2.lua	Thu Mar 23 16:48:18 2023 +0100
+++ b/mod_http_oauth2/mod_http_oauth2.lua	Fri Mar 24 00:07:58 2023 +0100
@@ -527,7 +527,7 @@
 		return render_page(templates.login, { state = auth_state, client = client });
 	elseif auth_state.consent == nil then
 		-- Render consent page
-		return render_page(templates.consent, { state = auth_state; client = client; scopes = parse_scopes(params.scope) }, true);
+		return render_page(templates.consent, { state = auth_state; client = client; scopes = parse_scopes(params.scope or "") }, true);
 	elseif not auth_state.consent then
 		-- Notify client of rejection
 		return error_response(request, oauth_error("access_denied"));