Skip to content

RegisterController

Paulina Szulc edited this page Jun 23, 2025 · 1 revision

RegisterController

This page contains documentation for the RegisterController class, which handles user registration, availability checks, and email confirmation.

Basic Information

Base Path: /api/v1/register
Package: dev.goral.rpghandyhelper.user.register

Authentication

No authentication is required for these endpoints.


Endpoint Summary

HTTP Method Path Description
POST /signup Registers a new user
GET /confirm Confirms user email with a token
GET /checkUsername Checks if username is available
GET /checkEmail Checks if email is available

Field Descriptions

Request Body Fields (RegisterRequest)

  • username (String): Desired username. Required.
  • firstName (String): First name of the user. Required.
  • surname (String): Surname of the user. Required.
  • email (String): User’s email address. Required.
  • password (String): User password. Must meet complexity rules. Required.
  • captcha (String): CAPTCHA response from frontend. Required.

Response Fields

  • message (String): Describes the result of the operation.
  • error (Integer): HTTP status code.
  • timestamp (String): Time the response was generated.

Endpoint Details

Register New User

Method: POST
Path: /signup

Response

{
  "message": "Konto zostało utworzone. Sprawdź swoją skrzynkę e-mail, aby aktywować konto.",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 400 Bad Request: Invalid CAPTCHA, username/email already taken, or weak password.
  • "Recaptcha verification failed"
  • "Nazwa użytkownika jest już zajęta."
  • "Ten adres e-mail jest już zarejestrowany."
  • "Hasło musi zawierać co najmniej 8 znaków..."

Confirm Email Token

Method: GET
Path: /confirm

Query Parameters

  • token (String): Email verification token

Response

{
  "message": "Konto zostało aktywowane. Możesz się teraz zalogować.",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 400 Bad Request: Token is invalid or expired.
  • "Nieprawidłowy lub nieaktywny token weryfikacyjny"

Check Username Availability

Method: GET
Path: /checkUsername

Query Parameters

  • username (String): Username to check

Response (Available)

{
  "message": "Nazwa użytkownika jest dostępna.",
  "error": 200,
  "timestamp": "..."
}

Response (Unavailable)

{
  "message": "Nazwa użytkownika jest już zajęta.",
  "error": 409,
  "timestamp": "..."
}

Check Email Availability

Method: GET
Path: /checkEmail

Query Parameters

  • email (String): Email to check

Response (Available)

{
  "message": "Adres e-mail jest dostępny.",
  "error": 200,
  "timestamp": "..."
}

Response (Unavailable)

{
  "message": "Ten adres e-mail jest już zarejestrowany.",
  "error": 409,
  "timestamp": "..."
}

Common Troubleshooting Tips

  • Weak Password: Ensure the password meets complexity requirements (min. 8 chars, digit, uppercase, lowercase, special character).
  • Email/Username Taken: Choose another email or username.
  • Recaptcha Error: Make sure the CAPTCHA is completed correctly.
  • Token Issues: Confirm you are using the correct and active token from the verification email.

Clone this wiki locally