Skip to content

Commit

Permalink
feat: precompute month
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierJp committed Sep 12, 2024
1 parent 31f354a commit 60beced
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pages/api/auth/agent-connect/callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@ import { agentConnectAuthenticate } from '#clients/authentication/agent-connect/
import { HttpForbiddenError } from '#clients/exceptions';
import { Exception } from '#models/exceptions';
import { IAgentInfo, getAgent } from '#models/user/agent';
import { formatDatePartial } from '#utils/helpers';
import { logInGrist } from '#utils/integrations/grist';
import { logFatalErrorInSentry } from '#utils/sentry';
import { cleanPathFrom, getPathFrom, setAgentSession } from '#utils/session';
import withSession from '#utils/session/with-session';

const logConnexion = (agent: IAgentInfo) => {
// log connexion in grist - no need to await
const date = new Date().toISOString();
logInGrist('logs-connexion', [
{
type: agent.userType,
userID: agent.userId,
idpID: agent.idpId,
siret: agent.siret,
domain: agent.domain,
date: new Date().toISOString(),
date,
mois: formatDatePartial(date),
},
]);
};
Expand Down

0 comments on commit 60beced

Please sign in to comment.