-
Notifications
You must be signed in to change notification settings - Fork 8
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
c15fdb3
commit 8be6cbd
Showing
18 changed files
with
109 additions
and
131 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,19 +1,16 @@ | ||
# N.B: When writting the below credentials ommit the curl braces. | ||
|
||
DbUrl=postgres://{POSTGRES_USER}:{your-user-password}@{HOST}:{PORT}/{DB} | ||
PostgresUser={your-user-name} | ||
PostgresPassword={your-user-password} | ||
PostgresDb={database} | ||
|
||
# Coverall settings | ||
RepoToken=repo token_for_coveralls | ||
# Database settings | ||
DB_URL=postgres://{postgres-user}:{user-password}@{host}:{port}/{database} | ||
POSTGRES_USER={postgres-user} | ||
POSTGRES_PASSWORD={user-password} | ||
POSTGRES_DB={database} | ||
REPO_TOKEN={token} | ||
|
||
# bcrypt settings | ||
SaltRounds=6 | ||
SALT_ROUNDS={salt-rounds} | ||
|
||
# jwt settings | ||
SecretKey=secrete-man | ||
TokenExpireTime=24h | ||
SECRET_KEY={your-secret} | ||
TOKEN_EXPIRE_TIME={time} | ||
|
||
# for swagger | ||
BaseUrl=localhost:3000 | ||
BASE_URL={host-and-port} |
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
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 @@ | ||
import express from 'express'; | ||
import UsersController from '../../controllers/signup.controller'; | ||
import loginHandler from '../../controllers/login.controller'; | ||
import loginMiddleware from '../../middlewares/login.middleware'; | ||
import { signupValidator, loginValidator } from '../../validations/auth.validation'; | ||
|
||
const { userExist, isAccountActive } = loginMiddleware; | ||
|
||
const router = express.Router(); | ||
|
||
router.post('/signup', signupValidator, UsersController.signUp); // API route for user to signup | ||
router.post('/login', loginValidator, userExist, isAccountActive, loginHandler.login); // API route for user to login | ||
|
||
export default router; |
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.