UNPKG

@opengis/fastify-table

Version:

core-plugins

18 lines (17 loc) 497 B
import pgClients from "../../pg/pgClients.js"; import dataInsert from "../../crud/funcs/dataInsert.js"; export default async function logAuth({ uid, type = "login", data, ip, }, pg = pgClients.client) { const res = await dataInsert({ pg, table: "log.user_auth", uid, data: { user_id: uid, auth_date: new Date().toISOString(), auth_type: type, auth_data: data, ip, }, }); return res; }