nodeSolidServer / nodeSolidServer/node-solid-server

User Registration problems via JSON

Open
#1,023 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

revisit
Dominant language
JavaScript
Stars
1.8k
Forks
308
PR merge metrics
No merged PRs in 30d

Description

I want to be able to register users through the solid server api via the /api/accounts/new endpoint. Using python I could do the following:

import requests

data = {
    'email': '...valid email',
    'username': '...valid username',
    'name': '...valid name',
    'password': '...valid password'
}
url = 'https://mysolidserver.com/api/accounts/new'
response = requests.post(url, data=data)
print(response.status_code) # which is 401

I am given a status code of 401 since I'm redirected to the username.mysolidserver.com page. This is awkward API UX since I'm expecting a confirmation response, probably in JSON with a status code in the 200's. Moreover, if I set headers={'Content-Type': 'application/json'} in the request, I am given an error claiming that the username is not valid.

Fortunately if the registration doesn't work, I'm given a status code of 400, so I can use this fact right now in my app.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing POST requests to /api/accounts/new with form data and application/json, checking redirects, status codes, and response bodies. The change is done when valid registrations receive a useful JSON success response with a 2xx status and invalid registrations continue to return an appropriate error response.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
api, authentication, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.