Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Prevent case that login search string is empty #9

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/SolidClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ class SolidClient {
if (this.isAboveVersion511(loginResponse.headers['x-powered-by'])) {
const consentUrl = new URL(authUrl);
const search = consentUrl.search.substring(1);
let consPostData = JSON.parse('{"' + decodeURIComponent(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/\=/g, '":"') + '"}');
const searchJson = decodeURIComponent(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/\=/g, '":"');
let consPostData = searchJson ? JSON.parse(`{"${searchJson}"}`) : {};
consPostData.consent = true;
consPostData.access_mode = ['Read', 'Write', 'Append', 'Control'];
consPostData = querystring.stringify(consPostData);
Expand Down