lib/rodauth/features/oauth_implicit_grant.rb in rodauth-oauth-1.0.0.pre.beta2 vs lib/rodauth/features/oauth_implicit_grant.rb in rodauth-oauth-1.0.0

- old
+ new

@@ -46,9 +46,19 @@ }.merge(grant_params) generate_token(grant_params, false) end + def _redirect_response_error(redirect_url, query_params) + response_types = param("response_type").split(/ +/) + + return super if response_types.empty? || response_types == %w[code] + + query_params = query_params.map { |k, v| "#{k}=#{v}" } + redirect_url.fragment = query_params.join("&") + redirect(redirect_url.to_s) + end + def authorize_response(params, mode) return super unless mode == "fragment" redirect_url = URI.parse(redirect_uri) params = params.map { |k, v| "#{k}=#{v}" }