Skip to content

Commit

Permalink
Merge pull request #1846 from gettakaro/produktly-identify-users
Browse files Browse the repository at this point in the history
More Produktly integration
  • Loading branch information
niekcandaele authored Dec 15, 2024
2 parents bcd8642 + 087862e commit ca92a2b
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 ca92a2b

Please sign in to comment.