Skip to content

Commit

Permalink
feat: identity users with Produktly
Browse files Browse the repository at this point in the history
  • Loading branch information
niekcandaele committed Dec 15, 2024
1 parent fc99f56 commit 087862e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/web-main/src/hooks/useAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
email: session.user.email,
domain: session.domain,
});

// @ts-expect-error - We load Produktly via a script tag in the index...
window.Produktly.identifyUser(session.user.idpId, {
domain: session.domain,
createdAt: session.user.createdAt,
email: session.user.email,
permissions: session.user.roles.map((role) => role.role.permissions.map((p) => p.permission.permission)).flat(),
});
}, []);

const getSession = async function (): Promise<MeOutputDTO> {
Expand Down

0 comments on commit 087862e

Please sign in to comment.