Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/features/auth/lib/next-auth-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ const providers: Provider[] = [
belongsToActiveTeam: hasActiveTeams,
locale: user.locale,
profile: user.allProfiles[0],
createdAt: user.createdDate,
createdDate: user.createdDate,
};
},
}),
Expand Down Expand Up @@ -941,12 +941,12 @@ export const getOptions = ({
*/
const user = message.user as User & {
username: string;
createdAt: string;
createdDate: string;
};
// check if the user was created in the last 10 minutes
// this is a workaround – in the future once we move to use the Account model in the DB
// we should use NextAuth's isNewUser flag instead: https://next-auth.js.org/configuration/events#signin
const isNewUser = new Date(user.createdAt) > new Date(Date.now() - 10 * 60 * 1000);
const isNewUser = new Date(user.createdDate) > new Date(Date.now() - 10 * 60 * 1000);
if ((isENVDev || IS_CALCOM) && process.env.DUB_API_KEY && isNewUser) {
const clickId = getDubId();
// check if there's a clickId (dub_id) cookie set by @dub/analytics
Expand Down