-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#163519140 add reset password via email endpoint (#15)
* reset-password(user): reset password reset via email - forget password endpoint - send reset password email to a user - reset password endpoint - send confirmation email to a user - unit test - increase test coverage - change response body - change status code - changing emails response [Delivers #163519140]
- Loading branch information
1 parent
5f54a40
commit 7322627
Showing
10 changed files
with
377 additions
and
16 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
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
30 changes: 30 additions & 0 deletions
30
database/migrations/20190213154608-create-reset-password.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,30 @@ | ||
module.exports = { | ||
up: (queryInterface, Sequelize) => { | ||
return queryInterface.createTable('ResetPasswords', { | ||
id: { | ||
allowNull: false, | ||
primaryKey: true, | ||
type: Sequelize.UUID, | ||
defaultValue: Sequelize.UUIDV4 | ||
}, | ||
userId: { | ||
type: Sequelize.UUID | ||
}, | ||
resetCode: { | ||
type: Sequelize.UUID, | ||
defaultValue: Sequelize.UUIDV4 | ||
}, | ||
createdAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE | ||
}, | ||
updatedAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE | ||
} | ||
}); | ||
}, | ||
down: (queryInterface, Sequelize) => { | ||
return queryInterface.dropTable('ResetPasswords'); | ||
} | ||
}; |
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,33 @@ | ||
module.exports = (sequelize, DataTypes) => { | ||
const ResetPassword = sequelize.define( | ||
'ResetPassword', | ||
{ | ||
id: { | ||
allowNull: false, | ||
primaryKey: true, | ||
type: DataTypes.UUID, | ||
defaultValue: DataTypes.UUIDV4 | ||
}, | ||
userId: { | ||
type: DataTypes.UUID | ||
}, | ||
resetCode: { | ||
type: DataTypes.UUID, | ||
defaultValue: DataTypes.UUIDV4 | ||
}, | ||
createdAt: { | ||
allowNull: false, | ||
type: DataTypes.DATE | ||
}, | ||
updatedAt: { | ||
allowNull: false, | ||
type: DataTypes.DATE | ||
} | ||
}, | ||
{} | ||
); | ||
ResetPassword.associate = function(models) { | ||
ResetPassword.belongsTo(models.User, { foreignKey: 'userId' }); | ||
}; | ||
return ResetPassword; | ||
}; |
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
Oops, something went wrong.