mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 06:34:39 -04:00
Add token based security feature
In the current setup users could be tricked into deleting their data by providing a malicious link like `[click me](/me/delete)`. This commit prevents such an easy attack and need the user's deleteToken to get his data deleted. In case someone requests his deletion by email you can also ask him for this token. We can add a GUI that shows it later on. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
parent
9fd09a8dfb
commit
70df29790a
5 changed files with 53 additions and 13 deletions
|
@ -31,6 +31,10 @@ module.exports = function (sequelize, DataTypes) {
|
|||
refreshToken: {
|
||||
type: DataTypes.STRING
|
||||
},
|
||||
deleteToken: {
|
||||
type: DataTypes.UUID,
|
||||
defaultValue: Sequelize.UUIDV4
|
||||
},
|
||||
email: {
|
||||
type: Sequelize.TEXT,
|
||||
validate: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue