Skip to content

Scheduling infrastructure for absolutely everyone.

feat: custom auth preparations

zomarsc2e91b837874
diff --git a/packages/features/auth/lib/next-auth-custom-adapter.ts b/packages/features/auth/lib/next-auth-custom-adapter.ts
index 4d5ff9f32a9..80f4efabce4 100644
--- a/packages/features/auth/lib/next-auth-custom-adapter.ts
+++ b/packages/features/auth/lib/next-auth-custom-adapter.ts
@@ -14,7 +14,8 @@ import { identityProviderNameMap } from "./identityProviderNameMap";
export default function CalComAdapter(prismaClient: PrismaClient) {
return {
createUser: (data: Prisma.UserCreateInput) => prismaClient.user.create({ data }),
- getUser: (id: User["id"]) => prismaClient.user.findUnique({ where: { id } }),
+ getUser: (id: string | number) =>
+ prismaClient.user.findUnique({ where: { id: typeof id === "string" ? parseInt(id) : id } }),
getUserByEmail: (email: User["email"]) => prismaClient.user.findUnique({ where: { email } }),
async getUserByAccount(provider_providerAccountId: {
providerAccountId: Account["providerAccountId"];
diff --git a/packages/features/auth/lib/sendVerificationRequest.ts b/packages/features/auth/lib/sendVerificationRequest.ts
index a32a0fb544c..69271853052 100644
--- a/packages/features/auth/lib/sendVerificationRequest.ts
+++ b/packages/features/auth/lib/sendVerificationRequest.ts
@@ -15,7 +15,7 @@ const transporter = nodemailer.createTransport<TransportOptions>({
const sendVerificationRequest = async ({ identifier, url }: SendVerificationRequestParams) => {
const emailsDir = path.resolve(process.cwd(), "..", "..", "packages/emails", "templates");
const originalUrl = new URL(url);
- const webappUrl = new URL(WEBAPP_URL);
+ const webappUrl = new URL(process.env.NEXTAUTH_URL || WEBAPP_URL);
if (originalUrl.origin !== webappUrl.origin) {
url = url.replace(originalUrl.origin, webappUrl.origin);
}
diff --git a/packages/ui/components/toast/showToast.tsx b/packages/ui/components/toast/showToast.tsx
index df082db640d..16b43a9f5b7 100644
--- a/packages/ui/components/toast/showToast.tsx
+++ b/packages/ui/components/toast/showToast.tsx
@@ -69,16 +69,12 @@ export function showToast(
) {
switch (variant) {
case "success":
- toast.custom((t) => <SuccessToast message={message} toastVisible={t.visible} />, { duration });
- break;
+ return toast.custom((t) => <SuccessToast message={message} toastVisible={t.visible} />, { duration });
case "error":
- toast.custom((t) => <ErrorToast message={message} toastVisible={t.visible} />, { duration });
- break;
+ return toast.custom((t) => <ErrorToast message={message} toastVisible={t.visible} />, { duration });
case "warning":
- toast.custom((t) => <WarningToast message={message} toastVisible={t.visible} />, { duration });
- break;
+ return toast.custom((t) => <WarningToast message={message} toastVisible={t.visible} />, { duration });
default:
- toast.custom((t) => <DefaultToast message={message} toastVisible={t.visible} />, { duration });
- break;
+ return toast.custom((t) => <DefaultToast message={message} toastVisible={t.visible} />, { duration });
}
}
diff --git a/packages/ui/package.json b/packages/ui/package.json
index eedf0bb42f6..c25cbaa366e 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -6,6 +6,7 @@
"main": "./index.tsx",
"exports": {
".": "./index.tsx",
+ "./components/toast": "./components/toast/index.tsx",
"./components/icon": "./components/icon/index.ts"
},
"types": "./index.tsx",
diff --git a/yarn.lock b/yarn.lock
index 1acd30a1211..3cdf3062e2d 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3844,8 +3844,10 @@ __metadata:
eslint-config-next: ^13.2.1
next: ^13.4.6
next-auth: ^4.20.1
+ postcss: ^8.4.18
react: ^18.2.0
react-dom: ^18.2.0
+ tailwindcss: ^3.3.1
typescript: ^4.9.4
languageName: unknown
linkType: soft