Last active
October 22, 2021 20:41
-
-
Save medkhelifi/2e38f0fa7e894f50639b9539d0e35c42 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Creer un utilisateur administrateur | |
User.findOrCreate({ | |
where: {username:"admin", }, | |
defaults: { | |
username: "admin", | |
email: "[email protected]", | |
password: bcrypt.hashSync("admin", 4), | |
}, | |
}).then((users) => { | |
users[0].setRoles([2]).then(() => { | |
({ | |
message: "L'administrateur a été enregistré avec succès !", | |
}); | |
}); | |
}) | |
.catch((err) => { | |
({ message: err.message }); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment