Fix #617 again #2187

Closed
raven wants to merge 1 commit from gitlab-mr-iid-920 into develop
Member

Sometime after I did the original fix for #617, error.error also became a JSON string, and it that was causing an exception.

Closes #617. (Hopefully for real)

Sometime after I did the original fix for #617, `error.error` also became a JSON string, and it that was causing an exception. Closes #617. (Hopefully for real)
Owner

My question is why on earth does BE return errors formatted differently for the same request? @lambadalambda @rinpatch

For username already taken: "{\"error\":\"{\\\"ap_id\\\":[\\\"has already been taken\\\"]}\"}"

For captcha: {"error":"{\"captcha\":[\"Invalid CAPTCHA\"]}"}

I think this should be fixed in BE side

My question is why on earth does BE return errors formatted differently for the same request? @lambadalambda @rinpatch For username already taken: `"{\"error\":\"{\\\"ap_id\\\":[\\\"has already been taken\\\"]}\"}"` For captcha: `{"error":"{\"captcha\":[\"Invalid CAPTCHA\"]}"}` I think this should be fixed in BE side
Owner

it should probably just output error data without the { error: _ } object, just have a correct status code is enough

it should probably just output error data without the `{ error: _ }` object, just have a correct status code is enough
Member

{ error: "string" } is mastoapi representation for errors

`{ error: "string" }` is mastoapi representation for errors
Member

I agree, error should be a string

I agree, `error` should be a string
Owner

the problem is the outer quotes, which are missing in the captcha error

the problem is the outer quotes, which are missing in the captcha error
Author
Member

Is "string" just a plain string, or is it an object serialized as a string?

Is `"string"` just a plain string, or is it an object serialized as a string?
Author
Member

Also, besides pleroma-fe, are there any known clients that use the existing registration endpoint?

Also, besides pleroma-fe, are there any known clients that use the existing registration endpoint?
Member

This was resolved on the BE side.

This was resolved on the BE side.

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma/pleroma-fe!2187
No description provided.