IO-992 Job Audit Logs
This commit is contained in:
@@ -17,6 +17,46 @@ admin.initializeApp({
|
||||
|
||||
exports.admin = admin;
|
||||
|
||||
const adminEmail = [
|
||||
"patrick@imex.dev",
|
||||
"patrick@imex.text",
|
||||
"patrick@imex.prod",
|
||||
"patrick@imexsystems.ca",
|
||||
"patrick@thinkimex.com",
|
||||
];
|
||||
|
||||
exports.updateUser = (req, res) => {
|
||||
console.log("USer Requesting", req.user);
|
||||
if (!adminEmail.includes(req.user.email)) {
|
||||
res.sendStatus(404);
|
||||
}
|
||||
|
||||
admin
|
||||
.auth()
|
||||
.updateUser(
|
||||
req.body.uid,
|
||||
req.body.user
|
||||
// {
|
||||
// email: "modifiedUser@example.com",
|
||||
// phoneNumber: "+11234567890",
|
||||
// emailVerified: true,
|
||||
// password: "newPassword",
|
||||
// displayName: "Jane Doe",
|
||||
// photoURL: "http://www.example.com/12345678/photo.png",
|
||||
// disabled: true,
|
||||
// }
|
||||
)
|
||||
.then((userRecord) => {
|
||||
// See the UserRecord reference doc for the contents of userRecord.
|
||||
console.log("Successfully updated user", userRecord.toJSON());
|
||||
res.json(userRecord);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("Error updating user:", error);
|
||||
res.status(500).json(error);
|
||||
});
|
||||
};
|
||||
|
||||
exports.sendNotification = (req, res) => {
|
||||
var registrationToken =
|
||||
"fqIWg8ENDFyrRrMWJ1sItR:APA91bHirdZ05Zo66flMlvala97SMXoiQGwP4oCvMwd-vVrSauD_WoNim3kXHGqyP-bzENjkXwA5icyUAReFbeHn6dIaPcbpcsXuY73-eJAXvZiu1gIsrd1BOsnj3dEMT7Q4F6mTPth1";
|
||||
|
||||
Reference in New Issue
Block a user