Skip to content

neuodev/arblog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArBlog

Server API

POST /api/v1/email

Description

The endpoint adds a new email to the database and sends a confirmation email to the user.

Request body

type RequestBody = {
  email: string;
};

Response

type Response =
  | { success: true } // status: 201
  | {
      success: false;
      error: string;
    };
GET /api/v1/email/confirm

Description

The endpoint marks the user email as confirmed using the confirmation token generated when the user added his email.

Param Description
token The token generated when the user added his email (it will be in the email sent to the user inbox)

Example: /api/v1/email/confirm?token=mytoken

Response

type Response =
  | { success: true } // status: 200
  | {
      success: false;
      error: string;
    };