2018-09-03 23:05:50 +03:00
|
|
|
## Set up the environment
|
|
|
|
|
|
|
|
Install node version manager and required version of node js
|
|
|
|
```
|
|
|
|
$ chmod u+x ./bin/nvm.sh && ./bin/nvm.sh
|
|
|
|
$ nvm install
|
|
|
|
```
|
|
|
|
|
|
|
|
> For windows use [nvm for windows](https://github.com/coreybutler/nvm-windows)
|
|
|
|
|
|
|
|
Install Yarn package manager
|
|
|
|
```
|
|
|
|
$ brew install yarn --without-node
|
|
|
|
```
|
|
|
|
|
|
|
|
> Use `--without-node` flag because nvm version of Node is used
|
|
|
|
|
|
|
|
Or download it directly from the [website](https://yarnpkg.com/en/docs/install)
|
|
|
|
|
|
|
|
## Install npm packages
|
|
|
|
|
|
|
|
```
|
|
|
|
$ yarn install --frozen-lockfile
|
|
|
|
```
|
|
|
|
|
|
|
|
## Available scripts
|
|
|
|
|
|
|
|
### Start the server
|
|
|
|
|
|
|
|
```
|
|
|
|
$ yarn start
|
|
|
|
```
|
|
|
|
|
|
|
|
### Run ESLint with `--fix` option
|
|
|
|
|
|
|
|
```
|
|
|
|
$ yarn lint
|
|
|
|
```
|
|
|
|
|
|
|
|
### Run tests
|
|
|
|
|
|
|
|
```
|
|
|
|
$ yarn test
|
|
|
|
```
|
Authentication (#22)
* Authorization added
* added secret to password, md5 hashing, removed promise from verifyToken, deleted links when not authorized
* added dbinsert script
* turned verifyToken to middleware, added description for dbinsert, added hidden csrf field in auth form
* added middlewares, user model and controller
* JSDoc fix
* wrong password processing fix
* added comments to dbinsert script, moved salt and passHash to singe db doc
* Moved salt to .env, upgradedscript for generating password was, fixed comments and JSDoc
* Deleted using salt (now user is only one), changed verifying password to bcrypt.compare, added httpyOnly property to jwt cookie
2019-03-06 13:22:57 +03:00
|
|
|
|
|
|
|
### Authentication
|
|
|
|
|
|
|
|
To manage pages you need to authorize (available on `/auth`).
|
|
|
|
|
|
|
|
To generate password use `yarn generatePassword [password]` command.
|