Authentication

Here you will find everything about authentication

Authenticate a new user

POST http://localhost:3001/auth/signup

Request Body

Name
Type
Description

email*

string

user's email

username*

string

user's username

maxLength: 30

profile*

object

user's profile

profile.name*

string

user's name

maxLength: 60

password*

string

user's password

minLength: 6

profile.socialMediaURLs*

object

object with supported social media URLs

profile.socialMediaURLs.gitHub

string

user's GitHub URL

profile.socialMediaURLs.linkedIn

string

user's LinkedIn URL

profile.socialMediaURLs.instagram

string

user's Instagram URL

profile.socialMediaURLs.twitter

string

user's Twitter URL

profile.socialMediaURLs.facebook

string

user's Facebook URL

Request

curl --location --request POST 'http://localhost:3001/auth/signUp' \
--data-raw '{
    "email": "[email protected]",
    "password": "123456",
    "username": "example",
    "profile": {
        "name": "Example",
        "socialMediaURLs": {}S
    }
}'

Response

JSON
{
    "id": "63cd0f17b570328000845e2d",
    "createdAt": "2023-01-22T10:25:27.336Z",
    "updatedAt": "2023-01-22T10:25:27.336Z",
    "username": "example",
    "email": "[email protected]",
    "roles": [
        "USER"
    ],
    "profile": {
        "name": "Example",
        "emailVerified": null,
        "photo": null,
        "socialMediaURLs": {
            "gitHub": null,
            "linkedIn": null,
            "instagram": null,
            "twitter": null,
            "facebook": null
        }
    },
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7ImlkIjoiNjNjZDBmMTdiNTcwMzI4MDAwODQ1ZTJkIiwiY3JlYXRlZEF0IjoiMjAyMy0wMS0yMlQxMDoyNToyNy4zMzZaIiwidXBkYXRlZEF0IjoiMjAyMy0wMS0yMlQxMDoyNToyNy4zMzZaIiwidXNlcm5hbWUiOiJleGFtcGxlIiwiZW1haWwiOiJleGFtcGxlQGdlbmZpZC5kZXYiLCJyb2xlcyI6WyJVU0VSIl0sInByb2ZpbGUiOnsibmFtZSI6IkV4YW1wbGUiLCJlbWFpbFZlcmlmaWVkIjpudWxsLCJwaG90byI6bnVsbCwic29jaWFsTWVkaWFVUkxzIjp7ImdpdEh1YiI6bnVsbCwibGlua2VkSW4iOm51bGwsImluc3RhZ3JhbSI6bnVsbCwidHdpdHRlciI6bnVsbCwiZmFjZWJvb2siOm51bGx9fX0sImlhdCI6MTY3NDM4MzEyNywiZXhwIjoxNjc0OTg3OTI3fQ.-SFuCh_CuWGVQBESXd1UrtP6AE1PSFn-owLiLAsspUk"
}

Authenticate a registred user

POST http://localhost:3001/auth/signin

Request Body

Name
Type
Description

email*

string

user's email

password*

string

user's password

Request

Response

Get signed user

GET http://localhost:3001/auth/profile

Headers

Name
Type
Description

Authorization

string

Bearer <access_token>

Cookies

Name
Type
Description

acceess_token

string

user's access token

(automatically sent by api)

Request

Response

Last updated

Was this helpful?