-
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.
166816202-feat(auth): Signup email verification
- setup nodemailer - update user model - update user controller - add mailer utils - add activation controller to verify email token - add tests - add sinon for mocking mail [Delivers #166816202]
- Loading branch information
1 parent
9526000
commit a3c889e
Showing
13 changed files
with
247 additions
and
155 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
17 changes: 17 additions & 0 deletions
17
db/migrations/20190701152259-alter-users-add-emailVerificationToken.js
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,17 @@ | ||
|
||
|
||
module.exports = { | ||
up: (queryInterface, Sequelize) => queryInterface | ||
.addColumn('Users', 'emailVerificationToken', { | ||
type: Sequelize.STRING, | ||
allowNull: true | ||
}) | ||
.then(() => queryInterface.addColumn('Users', 'activated', { | ||
type: Sequelize.BOOLEAN, | ||
allowNull: false, | ||
defaultValue: false | ||
})), | ||
down: queryInterface => queryInterface | ||
.removeColumn('Users', 'emailVerificationToken') | ||
.then(() => queryInterface.removeColumn('Users', 'activated')) | ||
}; |
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.
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,66 +1,66 @@ | ||
{ | ||
"name": "express-authorshaven", | ||
"version": "1.0.0", | ||
"description": "A Social platform for the creative at heart", | ||
"author": "Andela Simulations Programme", | ||
"license": "MIT", | ||
"entry": "server/index.js", | ||
"scripts": { | ||
"test": "NODE_ENV=test npm run migrate && nyc --reporter=html --reporter=text mocha \"tests/**/*.spec.js\" --require @babel/register --timeout 20000 --recursive --exit", | ||
"prettier": "prettier **/**/*.{js,json} --write", | ||
"dev": "nodemon --exec babel-node server/index", | ||
"migrate": "sequelize db:migrate", | ||
"seed": "sequelize db:seed:all", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
"*.js": [ | ||
"eslint --ext .json --ext .js --fix", | ||
"git add" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.4.4", | ||
"@babel/core": "^7.4.5", | ||
"@babel/node": "^7.4.5", | ||
"@babel/preset-env": "^7.4.5", | ||
"chai": "^4.2.0", | ||
"chai-http": "^4.3.0", | ||
"coveralls": "^3.0.4", | ||
"eslint": "^5.3.0", | ||
"eslint-config-airbnb-base": "^13.1.0", | ||
"eslint-config-prettier": "^6.0.0", | ||
"eslint-plugin-import": "^2.18.0", | ||
"eslint-plugin-prettier": "^3.1.0", | ||
"husky": "^2.5.0", | ||
"lint-staged": "^8.2.1", | ||
"mocha": "^6.1.4", | ||
"nodemon": "^1.19.1", | ||
"nyc": "^14.1.1", | ||
"prettier": "^1.18.2", | ||
"sequelize-cli": "^5.5.0" | ||
}, | ||
"dependencies": { | ||
"bcryptjs": "^2.4.3", | ||
"body-parser": "^1.19.0", | ||
"consola": "^2.9.0", | ||
"dotenv": "^8.0.0", | ||
"express": "^4.17.1", | ||
"indicative": "^5.0.8", | ||
"jsonwebtoken": "^8.5.1", | ||
"nodemailer": "^6.2.1", | ||
"pg": "^7.11.0", | ||
"pg-hstore": "^2.3.3", | ||
"sequelize": "^5.8.12", | ||
"swagger-ui-express": "^4.0.6", | ||
"parse-database-url": "^0.3.0", | ||
"sinon": "^7.3.2", | ||
"sequelize-slugify": "^0.7.0", | ||
"yamljs": "^0.3.0" | ||
} | ||
"name": "express-authorshaven", | ||
"version": "1.0.0", | ||
"description": "A Social platform for the creative at heart", | ||
"author": "Andela Simulations Programme", | ||
"license": "MIT", | ||
"entry": "server/index.js", | ||
"scripts": { | ||
"test": "NODE_ENV=test npm run migrate && NODE_ENV=test nyc --reporter=html --reporter=text mocha \"tests/**/*.spec.js\" --require @babel/register --timeout 20000 --recursive --exit", | ||
"prettier": "prettier **/**/*.{js,json} --write", | ||
"dev": "nodemon --exec babel-node server/index", | ||
"migrate": "sequelize db:migrate", | ||
"seed": "sequelize db:seed:all", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
"*.js": [ | ||
"eslint --ext .json --ext .js --fix", | ||
"git add" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.4.4", | ||
"@babel/core": "^7.4.5", | ||
"@babel/node": "^7.4.5", | ||
"@babel/preset-env": "^7.4.5", | ||
"chai": "^4.2.0", | ||
"chai-http": "^4.3.0", | ||
"coveralls": "^3.0.4", | ||
"eslint": "^5.3.0", | ||
"eslint-config-airbnb-base": "^13.1.0", | ||
"eslint-config-prettier": "^6.0.0", | ||
"eslint-plugin-import": "^2.18.0", | ||
"eslint-plugin-prettier": "^3.1.0", | ||
"husky": "^2.5.0", | ||
"lint-staged": "^8.2.1", | ||
"mocha": "^6.1.4", | ||
"nodemon": "^1.19.1", | ||
"nyc": "^14.1.1", | ||
"prettier": "^1.18.2", | ||
"sequelize-cli": "^5.5.0" | ||
}, | ||
"dependencies": { | ||
"bcryptjs": "^2.4.3", | ||
"body-parser": "^1.19.0", | ||
"consola": "^2.9.0", | ||
"dotenv": "^8.0.0", | ||
"express": "^4.17.1", | ||
"indicative": "^5.0.8", | ||
"jsonwebtoken": "^8.5.1", | ||
"nodemailer": "^6.2.1", | ||
"pg": "^7.11.0", | ||
"pg-hstore": "^2.3.3", | ||
"sequelize": "^5.8.12", | ||
"swagger-ui-express": "^4.0.6", | ||
"parse-database-url": "^0.3.0", | ||
"sinon": "^7.3.2", | ||
"sequelize-slugify": "^0.7.0", | ||
"yamljs": "^0.3.0" | ||
} | ||
} |
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,3 @@ | ||
export default () => ({ | ||
secret: process.env.JWT_SECRET || 'secret' | ||
}); |
Oops, something went wrong.