user and log
parent
09ee0a9654
commit
692114878a
|
@ -347,7 +347,7 @@ export async function Login(req: Request, res: Response) {
|
|||
|
||||
telegramNotification(
|
||||
1,
|
||||
`User logged in: user_id: ${user.user_id} email: ${email} language: ${user.language}`
|
||||
`User logged in: user_id: ${user.user_id} email: ${email}`
|
||||
);
|
||||
} catch (error) {
|
||||
logger.error("login error", error as string);
|
||||
|
|
|
@ -11,12 +11,23 @@ export async function telegramNotification(
|
|||
axios({
|
||||
url: `${process.env.ADMIN_DASHBOARD_TELEGRAM_NOTIFICATIONS_URL}`,
|
||||
method: "post",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Api-Key": process.env.ADMIN_DASHBOARD_TELEGRAM_NOTIFICATIONS_API_KEY,
|
||||
},
|
||||
data: {
|
||||
type: type,
|
||||
title: message,
|
||||
userIds: userIds || [],
|
||||
userIds: userIds || [
|
||||
"d2705d63-8668-4517-8b8b-e5396fb7e80b", // alex
|
||||
"61660369-3ac9-4365-ab35-e96d58cdba2a", // jan
|
||||
],
|
||||
},
|
||||
}).catch((error) => {
|
||||
logger.error("Telegram notification error:", error);
|
||||
});
|
||||
})
|
||||
.then((response) => {
|
||||
logger.info("Telegram notification response:", response.data);
|
||||
})
|
||||
.catch((error) => {
|
||||
logger.error("Telegram notification error:", error);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue