This package has been deprecated

Author message:

reason message

auth-mlsdev
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Build

Run yarn build to build the project.

Running unit tests

Run yarn test to execute the unit tests via [Karma].

Settings

To change FALLBACK URI:

{
  provide: FALLBACK_PAGE_URI,
  useValue: 'your path'
}

To use your custom auth service:

{
  provide: AUTH_SERVICE,
  deps: [ YourService ],
  useFactory: factory
}

API contract

Auth

Token based auth in header. Example:

"Authorization: Bearer ACCESS_TOKEN"

API End points

Session (Facebook) ???

POST /api/facebook/session

{
  "access_token": string
}

Responses:


Session (Google Plus)

POST /api/gooogle_plus/session

{
  "access_token": string
}

Responses:


Session (LinkedIn) ???

POST /api/linked_in/session

{
  "access_token": string
}

Responses:


Session (Twitter) ???

POST /api/twitter/session

{
  "access_token": string
}

Responses:


Session (Instagram) ???

POST /api/instagram/session

{
  "access_token": string
}

Responses:


Session (Pinterest) ???

POST /api/pinterest/session

{
  "access_token": string
}

Responses:


Session (Log in)

POST /api/session

{
  "session": {
    "email": string,
    "password": string,
    "password_confirmation": string,
  }
}

Responses:


Profile (Sign Up)

POST /api/profile

{
  "profile": {
    "email": string,
    "first_name": string,           // required
    "last_name": string,             // required
    "password": string,           // required
    "password_confirmation": string,           // required
  }
}

Responses:


Profile (Update)

PUT/PATCH /api/profile

{
  "profile": {
    "first_name": string,
    "last_name": string,
  }
}

Responses:


Change Password

POST /api/password_change

{
  "password_change": {
    "password": string,
    "new_password": string,
    "new_password_confirmation": string,
  }
}

Responses:


Session (Sign out)

DELETE /api/session

Responses:

  • 200
  • 401

Restore password

POST /api/restore_password

{
  "restore_password": {
    "email": string,
    "path":  string
  }
}

Response:

  • 200
  • 404

Restore password

GET /api/restore_passwords/:token

Response:

  • 200
  • 404

Reset password

POST /api/reset_password

{
  "reset_password": {
    "token": string,
    "password": string,
    "password_confirmation": string
  }
}

Responses:


Models

ErrorsModel

{
  "errors": {
    "base": string[] // everything that doesn't belong to `form`
    "email": string[],
    "password_confirmation": string[]
  }
}

UserModel

{
  "id": number,
  "role": string,
  "email": string,
  "phone": string,
  "banned": boolean,
  "first_name": string,
  "last_name": string,
  "avatar_url": string,
  "status": "completed" | "incompleted",
}

SessionModel

{
  "token": string,
  "user": [User](#usermodel)
}

Readme

Keywords

none

Package Sidebar

Install

npm i auth-mlsdev

Weekly Downloads

64

Version

0.1.3

License

MIT

Unpacked Size

396 kB

Total Files

77

Last publish

Collaborators

  • npm
  • leaf13