Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Import from Ferdi #11

Closed
wants to merge 2 commits into from

Conversation

SpecialAro
Copy link
Member

Description of Change

Feature: Import from Ferdi

Motivation and Context

With the new Ferdium Server, users may want to import their configurations not only from Franz but also from Ferdi. Attempts to solve #5.

Release Notes

Feature: Import from Ferdi.

@SpecialAro
Copy link
Member Author

Currently, importing from Ferdi gives this error:
image
{"message":"Cannot login to Ferdi","error":{"message":"invalid json response body at https://api.getferdi.com/user/login reason: Unexpected token E in JSON at position 0","type":"invalid-json"}}

Trying to solve this.

'x-franz-source': 'Web',
},
});
const content = await rawResponse.json();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably the problem - you are parsing the response to JSON here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that has to be changed so this can succeed. Though, the problem seems to be in the Fetch call

@SpecialAro
Copy link
Member Author

The fetch call seems to be failing because of a Ferdi Server restriction.
image

const rawResponse = await fetch(`${base}user/login`, { method: 'POST', body: JSON.stringify(loginBody), headers: { Authorization: `Basic ${basicToken}`, 'User-Agent': userAgent, 'Content-Type': 'application/json', accept: '*/*', 'x-ferdi-source': 'Web', }, });

@SpecialAro
Copy link
Member Author

Closing as discussed in ferdium/ferdium-app#9

@SpecialAro SpecialAro closed this May 10, 2022
@SpecialAro SpecialAro deleted the feature/import-from-Ferdi branch May 10, 2022 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants