1.0.14 • Published 5 years ago

auth-zanuro v1.0.14

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

Auth-Zanuro(alu0100968590)

This module was made to implement an authorization type middleware that would let you navigate through different paths. Therefore exports a function that returns an middleware used for that purpose.

Basic functioning

This module defines the following: 1. Route for accesing the content of the page through the /content path using the GET method, only when the user is logged in the current session 2. Route for login into the website through the /login route using the GET/POST method, to be able to visualize the content of the page you need to be logged in 3. Route for registering into the website through the /register route using the GET/POST method, to be able to login into the website you need a valid account.

Options

The function that exports the module needs an data type object,this object having the following attributes:

  1. passwordFile: this option declares the file/path of the path were the credentials will be stored

  2. pathToProtect: this option declares the route/path to the content of the website that only the logged user can see.

  3. registerView: this option represents the view of the register form that can be accesed through the /register path.

  4. successRegisterView: this option represents the succesfully made register view that is rendered when the account is succesfully created.

  5. errorRegisterView: this option represents an error view that is rendered when an error ocurrs while creating the account.

  6. loginView: this option represents the view of the login form that can be accesed through the /login path.

  7. successLoginView: this option represents the succesfully made login view that is rendered when the login is succesfully made.

  8. errorLoginView: this option represents an error view that is rendered when an error ocurrs while loging into the account.

  9. logoutView: this option represents the view that the user will get once they log out of their account

  10. unauthorizedView: this option represents the view that the user will get if they access the content(/content path) without being logged in.

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago