Confirm an account

Confirms a newly created User account. If confirmation is successful this will also result in a (passwordless) sign-in.

Endpoints

Confirming a new User account is possible via this endpoint:

MethodPathAuthentication
POST
/confirm/signup/:idNone
NOTE|

This endpoint requires no authentication

Request URL

The URL should contain the confirmation ID that was E-mailed to the E-mail address used for the signup. It replaces the :id placeholder in the endpoint listed above.

Request body

PropertyTypeDescription
consentNumberAn integer representing the consent given by the user to process their data

Response status codes

Possible status codes for these endpoints are:

Status codeDescription
200
success
400
the request was malformed
404
the confirmation was not found
500
server error
NOTE

If the status code is not

200
the error property in the response body should indicate the nature of the problem.

Response body

ValueTypeDescription
resultStringEither success or error
errorStringWill give info on the nature of the error. Only set if an error occurred.
tokenStringA JSON web token (JWT) token to authenticate with
account.idNumberThe ID of the User
account.bioStringThe bio of the User
account.consentNumberThe consent given by the User
account.controlNumberThe control desired by the User
account.createdAtStringDate string indicating the moment the User was created
account.emailStringThe E-mail address currently tied to the User
account.githubStringThe GitHub username of the User
account.imgStringThe URL to the image stored with this User
account.imperialBooleanWhether or not the User prefers imperial units
account.initialStringThe E-mail address that the User was created with
account.languageStringThe language preferred by the user
account.lastSignInStringDate string indicating them moment the User last signed in
account.mfaEnabledBooleanWhether or not the User has MFA enabled
account.newsletterBooleanWhether or not the User is subscribed to the FreeSewing newsletter
account.patronNumberThe level of patronage the user provides to FreeSewing
account.roleStringThe role of the User
account.statusNumberThe status of the user
account.updatedAtStringDate string indicating the last time the User was updated
account.usernameStringThe username of the User
account.lusernameStringA lowercased version of the username of the User

Example request

Javascript
const confirm = await axios.post(
  'https://backend.freesewing.org/confirm/signup/3985f312-e407-458a-a78c-4596c361d284',
  { consent: 2 },
)

Example response

JSON
200
{
  "result": "success",
  "token": "eyJhbGciOiJIUzI1NiIsInR5c...truncated",
  "account": {
    "id": 14,
    "bio": "",
    "consent": 1,
    "control": 1,
    "createdAt": "2022-11-19T18:15:22.642Z",
    "email": "test_54c6856275aaa8a1@freesewing.dev",
    "github": "",
    "img": "https://freesewing.org/avatar.svg",
    "imperial": false,
    "initial": "test_54c6856275aaa8a1@freesewing.dev",
    "language": "en",
    "lastSignIn": "2022-11-19T18:15:22.668Z",
    "mfaEnabled": false,
    "newsletter": false,
    "patron": 0,
    "role": "user",
    "status": 1,
    "updatedAt": "2022-11-19T18:15:22.668Z",
    "username": "user-14",
    "lusername": "user-14"
  }
}