Skip to content

Auth Service

Matthew Pfister edited this page Apr 17, 2020 · 7 revisions

Contracts

POST Login
POST Signup
POST Confirm Account
POST Logout
POST Resend Confirmation Code
POST Validate

[POST] /auth/login

Authenticate a user with our services

Request Body

{
  userName: string;
  password: string;
}

Response Headers

set-cookie: string;
x-id-token: string;
x-access-token: string;

Response Body

{
  status: number;
  data: {
    user: {
      id: string;
      userName: string;
      email: string;
      firstName?: string;
      lastName?: string;
      displayName: string;
      accountType: USER | ADMIN;
      isFirstTimeLogin: boolean;     
    }
  }
}

[POST] /auth/signup

Create a new user account

Request Body

{
  email: string;
  firstName?: string;
  lastName?: string;
  password: string;
  userName: string;
}

Response Body

{
  status: number;
  data: {
    user: {
      accountType: string;
      displayName: string;
      email: string;
      firstName?: string;
      id: string;
      isFirstTimeLogin?: boolean;
      lastName?: string;
      userName: string;   
    }
  }
}

[POST] /auth/confirm

Confirm a new user account

Request Body

{
  userName: string;
  verificationCode: string;
}

Response Body

{
  code: number;
  data: {
    message: string;
  }
}

[POST] /auth/logout

Invalidate a user's session with our services

Request Headers

{
  Authorization: Bearer Access Token;
}

Response Body

{
  code: number;
  data: {
    message: string;
  }
}

[POST] /auth/resend_code

Request a new account confirmation code

Request Body

{
  userName: string;
}

Response Body

{
  code: number;
  data: {
    message: string;
  }
}

[POST] /auth/validate

Validate a user's session with our services.

Request Headers

{
  Authorization: Bearer Access Token;
}

Response Body

{
  status: number;
  data: {
    user: {
      id: string;
      userName: string;
      email: string;
      firstName?: string;
      lastName?: string;
      displayName: string;
      accountType: USER | ADMIN;
      isFirstTimeLogin: boolean;     
    }
  }
}