-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59de8f4
commit b8bf13a
Showing
12 changed files
with
6,061 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
SERVER_PORT=3500 | ||
|
||
PRISMA_MANAGEMENT_API_SECRET=wsflk897dh%£ | ||
USER_SERVICE=http://user_app_1:3500 | ||
|
||
LOGGING_DRIVER=json-file | ||
|
||
DB_HOST= | ||
DB_PORT= | ||
DB_NAME= | ||
DB_USER= | ||
DB_PASSWORD= | ||
LOGGING_DRIVER=json-file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"keys": [ | ||
{ | ||
"kty": "oct", | ||
"k": "AyM1SysPpbyDfgZld3umj1qzKObwVMkoqQ-EstJQLr_T-1qS0gZH75aKtMN3Yj0iPS4hcgUuTwjAzZr1Z9CAow", | ||
"kid": "edgar", | ||
"alg": "HS256" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const axios = require('axios'); | ||
require('dotenv').config(); | ||
|
||
const userService = process.env.USER_SERVICE || 'http://user_app_1:3500'; | ||
|
||
const http = axios.create({ | ||
baseURL: userService, | ||
}); | ||
|
||
module.exports.createUser = (firstName, lastName, email, password) => http.put('users', { | ||
firstName, lastName, email, password, | ||
}); | ||
|
||
module.exports.getUsersByEmail = email => http.get(`users?type=manager&email=${email}`); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const { v4: uuidv4 } = require('uuid'); | ||
|
||
const getExpDate = () => new Date(Date.now() + 12096e5).getTime(); | ||
|
||
module.exports.getToken = (userId, role) => ({ | ||
accessToken: { | ||
sub: userId, | ||
jti: uuidv4(), | ||
roles: [role], | ||
exp: getExpDate(), | ||
}, | ||
exp: getExpDate(), | ||
}); |
Oops, something went wrong.