Auth

When the authRoutes option is set to true, Apiker will register the following default routes:

/auth/register , /auth/login , /auth/refresh , /auth/delete

➡️ POST /auth/register

Request body:

Plain Text
1email: xxxxx
2password: xxxxx

Response:

JSON
1{
2 "userId": "6bd0b8bb11f440460daa8c9d6c3f3c689d7...",
3 "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
4 "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
5}

Notes:

  • For auth implementation details, check out the source at Auth.ts
  • you would like to implement your own auth, you can always use the helpers at utils.ts. They are all exported from Apiker.
  • ⚠️ Note: Auth routes are in active development. There might be significant changes in future versions. PRs and suggestions are always welcome!