Updated account deletion process and refactor packages
The primary update was on the process of account deletion where email notifications are now sent to users. The @kit/emails was also renamed to @kit/email-templates and adjustments were accordingly made on the relevant code and configuration files. In addition, package interaction was refactored to enhance readability and ease of maintenance. Some minor alterations were made on the User Interface, and code comments were updated.
This commit is contained in:
@@ -36,7 +36,7 @@ const AppConfigSchema = z.object({
|
||||
});
|
||||
|
||||
const appConfig = AppConfigSchema.parse({
|
||||
name: 'Awesomely',
|
||||
name: process.env.NEXT_PUBLIC_PRODUCT_NAME,
|
||||
title: 'Awesomely - Your SaaS Title',
|
||||
description: 'Your SaaS Description',
|
||||
url: process.env.NEXT_PUBLIC_SITE_URL,
|
||||
|
||||
@@ -128,9 +128,12 @@ function getPatterns() {
|
||||
handler: async (req: NextRequest, res: NextResponse) => {
|
||||
const supabase = createMiddlewareClient(req, res);
|
||||
const { data } = await supabase.auth.getSession();
|
||||
|
||||
// check if we need to verify MFA (user is authenticated but needs to verify MFA)
|
||||
const isVerifyMfa = req.nextUrl.pathname === pathsConfig.auth.verifyMfa;
|
||||
|
||||
// If user is logged in, redirect to home page.
|
||||
// If user is logged in and does not need to verify MFA,
|
||||
// redirect to home page.
|
||||
if (data.session && !isVerifyMfa) {
|
||||
return NextResponse.redirect(
|
||||
new URL(pathsConfig.app.home, req.nextUrl.origin).href,
|
||||
@@ -157,10 +160,6 @@ function getPatterns() {
|
||||
const requiresMultiFactorAuthentication =
|
||||
await checkRequiresMultiFactorAuthentication(supabase);
|
||||
|
||||
console.log({
|
||||
requiresMultiFactorAuthentication,
|
||||
});
|
||||
|
||||
// If user requires multi-factor authentication, redirect to MFA page.
|
||||
if (requiresMultiFactorAuthentication) {
|
||||
return NextResponse.redirect(
|
||||
|
||||
@@ -15,6 +15,7 @@ const INTERNAL_PACKAGES = [
|
||||
'@kit/billing',
|
||||
'@kit/billing-gateway',
|
||||
'@kit/stripe',
|
||||
'@kit/email-templates',
|
||||
];
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
"@kit/auth": "^0.1.0",
|
||||
"@kit/billing": "^0.1.0",
|
||||
"@kit/billing-gateway": "^0.1.0",
|
||||
"@kit/emails": "^0.1.0",
|
||||
"@kit/email-templates": "^0.1.0",
|
||||
"@kit/i18n": "^0.1.0",
|
||||
"@kit/mailers": "^0.1.0",
|
||||
"@kit/shared": "^0.1.0",
|
||||
@@ -32,7 +32,7 @@
|
||||
"@next/mdx": "^14.1.0",
|
||||
"@radix-ui/react-icons": "^1.3.0",
|
||||
"@supabase/ssr": "^0.1.0",
|
||||
"@supabase/supabase-js": "^2.39.8",
|
||||
"@supabase/supabase-js": "^2.40.0",
|
||||
"@tanstack/react-query": "5.28.6",
|
||||
"@tanstack/react-query-next-experimental": "^5.28.6",
|
||||
"@tanstack/react-table": "^8.11.3",
|
||||
@@ -47,7 +47,7 @@
|
||||
"next-themes": "^0.2.1",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-hook-form": "^7.51.1",
|
||||
"react-hook-form": "^7.51.2",
|
||||
"react-i18next": "^14.1.0",
|
||||
"recharts": "^2.10.3",
|
||||
"rehype-autolink-headings": "^7.1.0",
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
"currentPassword": "Current Password",
|
||||
"newPassword": "New Password",
|
||||
"repeatPassword": "Repeat New Password",
|
||||
"repeatPasswordDescription": "Please repeat your new password to confirm it",
|
||||
"yourPassword": "Your Password",
|
||||
"updatePasswordSubmitLabel": "Update Password",
|
||||
"updateEmailCardTitle": "Update your Email",
|
||||
|
||||
Reference in New Issue
Block a user