Skip to content

Commit

Permalink
Merge branch 'devel' of github.com:Lend-it/User into 110_login
Browse files Browse the repository at this point in the history
  • Loading branch information
youssef-md committed Mar 28, 2021
2 parents 43e712b + 429371a commit fc75851
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Lint](https://github.com/Lend-it/User/actions/workflows/lint.yml/badge.svg)](https://github.com/Lend-it/User/actions/workflows/lint.yml) [![Sonar build](https://github.com/Lend-it/User/actions/workflows/sonar.yml/badge.svg)](https://github.com/Lend-it/User/actions/workflows/sonar.yml) [![Commit Linter](https://github.com/Lend-it/User/actions/workflows/commit-linter.yml/badge.svg)](https://github.com/Lend-it/User/actions/workflows/commit-linter.yml) [![Application Test](https://github.com/Lend-it/User/actions/workflows/app-test.yml/badge.svg)](https://github.com/Lend-it/User/actions/workflows/app-test.yml)
[![Lint](https://github.com/Lend-it/User/actions/workflows/lint.yml/badge.svg)](https://github.com/Lend-it/User/actions/workflows/lint.yml) [![Sonar build](https://github.com/Lend-it/User/actions/workflows/sonar.yml/badge.svg)](https://github.com/Lend-it/User/actions/workflows/sonar.yml) [![Commit Linter](https://github.com/Lend-it/User/actions/workflows/commit-linter.yml/badge.svg)](https://github.com/Lend-it/User/actions/workflows/commit-linter.yml) [![Application Test](https://github.com/Lend-it/User/actions/workflows/app-test.yml/badge.svg)](https://github.com/Lend-it/User/actions/workflows/app-test.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Lend-it_User&metric=alert_status)](https://sonarcloud.io/dashboard?id=Lend-it_User)
# User
Serviço responsável pela interação com o Usuário.

Expand Down Expand Up @@ -54,4 +54,4 @@ Todos os comandos abaixo requerem a instalação de Docker e Docker-Compose.

```shell
make check-db
```
```
14 changes: 14 additions & 0 deletions src/config/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,26 @@ export default {
database: process.env.POSTGRES_DATABASE,
host: process.env.POSTGRES_HOST,
dialect: 'postgres',
ssl: true,
dialectOptions: {
ssl: {
require: true,
rejectUnauthorized: false,
},
},
},
prod: {
username: process.env.POSTGRES_USER,
password: process.env.POSTGRES_PASSWORD,
database: process.env.POSTGRES_DATABASE,
host: process.env.POSTGRES_HOST,
dialect: 'postgres',
ssl: true,
dialectOptions: {
ssl: {
require: true,
rejectUnauthorized: false,
},
},
},
};
13 changes: 10 additions & 3 deletions src/controllers/UserController.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ const saltRounds = process.env.SALT_ROUNDS;

export default {
async create(request, response) {
const { useremail, name, whatsappnumber, password } = request.body;
const {
useremail,
name,
whatsappnumber,
password,
latitude,
longitude,
} = request.body;

const salt = bcrypt.genSaltSync(saltRounds);

Expand All @@ -28,8 +35,8 @@ export default {
name,
whatsappnumber,
password: hashedPassword,
latitude: 0,
longitude: 0,
latitude,
longitude,
});

const token = generateToken({ useremail });
Expand Down

0 comments on commit fc75851

Please sign in to comment.