mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 01:01:49 +10:00
fix: add sign up hook
This commit is contained in:
@ -19,12 +19,4 @@ export const onAuthorize = async (user: AuthorizeUser, c: Context<HonoAuthContex
|
||||
await createSession(sessionToken, user.userId, metadata);
|
||||
|
||||
await setSessionCookie(c, sessionToken);
|
||||
|
||||
// Todo.
|
||||
// Create the Stripe customer and attach it to the user if it doesn't exist.
|
||||
// if (user.customerId === null && IS_BILLING_ENABLED()) {
|
||||
// await getStripeCustomerByUser(user).catch((err) => {
|
||||
// console.error(err);
|
||||
// });
|
||||
// }
|
||||
};
|
||||
|
||||
@ -6,6 +6,7 @@ import { z } from 'zod';
|
||||
|
||||
import { NEXT_PUBLIC_WEBAPP_URL } from '@documenso/lib/constants/app';
|
||||
import { AppError, AppErrorCode } from '@documenso/lib/errors/app-error';
|
||||
import { onCreateUserHook } from '@documenso/lib/server-only/user/create-user';
|
||||
import { env } from '@documenso/lib/utils/env';
|
||||
import { prisma } from '@documenso/prisma';
|
||||
import { UserSecurityAuditLogType } from '@documenso/prisma/client';
|
||||
@ -232,6 +233,11 @@ export const googleRoute = new Hono<HonoAuthContext>()
|
||||
return user;
|
||||
});
|
||||
|
||||
await onCreateUserHook(createdUser).catch((err) => {
|
||||
// Todo: Add logging.
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
await onAuthorize({ userId: createdUser.id }, c);
|
||||
|
||||
return c.redirect(redirectPath, 302);
|
||||
|
||||
Reference in New Issue
Block a user