Skip to content

Commit

Permalink
switch secret name
Browse files Browse the repository at this point in the history
  • Loading branch information
selfagency committed Jan 27, 2025
1 parent 943a116 commit cb35719
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 30 deletions.
36 changes: 15 additions & 21 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true },
modules: [
"@nuxt/ui",
"@sidebase/nuxt-auth",
"dayjs-nuxt",
"@pinia/nuxt",
"@productdevbook/chatwoot",
],
modules: ['@nuxt/ui', '@sidebase/nuxt-auth', 'dayjs-nuxt', '@pinia/nuxt', '@productdevbook/chatwoot'],
app: {
head: {
title: "OpenformStack",
title: 'OpenformStack',
meta: [
{
name: "description",
name: 'description',
content:
"Open source form backend that allows you to collect form submissions without writing any backend code",
'Open source form backend that allows you to collect form submissions without writing any backend code',
},
{ charset: "utf-8" },
{ charset: 'utf-8' },
],
},
},
runtimeConfig: {
GOOGLE_CLIENT_SECRET: process.env.GOOGLE_CLIENT_SECRET,
API_ROUTE_SECRET: process.env.API_ROUTE_SECRET,
AUTH_SECRET: process.env.AUTH_SECRET,
RESEND_API_KEY: process.env.RESEND_API_KEY,
STRIPE_SECRET_KEY: process.env.STRIPE_SECRET_KEY,
STRIPE_WEBHOOK_SECRET: process.env.STRIPE_WEBHOOK_SECRET,
Expand All @@ -36,27 +30,27 @@ export default defineNuxtConfig({
BASE_URL: process.env.BASE_URL,

// SEO
siteUrl: process.env.BASE_URL || "https://openformstack.com",
siteName: "OpenformStack",
siteUrl: process.env.BASE_URL || 'https://openformstack.com',
siteName: 'OpenformStack',
siteDescription:
"Open source form backend that allows you to collect form submissions without writing any backend code",
language: "en",
'Open source form backend that allows you to collect form submissions without writing any backend code',
language: 'en',
},
},
pinia: {
autoImports: ["defineStore", ["defineStore", "definePiniaStore"]],
autoImports: ['defineStore', ['defineStore', 'definePiniaStore']],
},
colorMode: {
preference: "light",
preference: 'light',
},
chatwoot: {
init: {
websiteToken: process.env.CHATWOOT_WEBSITE_TOKEN,
},
settings: {
locale: "en",
position: "left",
launcherTitle: "Chat",
locale: 'en',
position: 'left',
launcherTitle: 'Chat',
},
},
});
18 changes: 9 additions & 9 deletions server/api/auth/[...].ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { NuxtAuthHandler } from "#auth";
import GoogleProvider from "next-auth/providers/google";
import { PrismaAdapter } from "@next-auth/prisma-adapter";
import { PrismaClient } from "@prisma/client";
import { NuxtAuthHandler } from '#auth';
import GoogleProvider from 'next-auth/providers/google';
import { PrismaAdapter } from '@next-auth/prisma-adapter';
import { PrismaClient } from '@prisma/client';

const runtimeConfig = useRuntimeConfig();
const prisma = new PrismaClient();

export default NuxtAuthHandler({
adapter: PrismaAdapter(prisma),
secret: useRuntimeConfig().API_ROUTE_SECRET,
secret: useRuntimeConfig().AUTH_SECRET,
session: {
strategy: "jwt",
strategy: 'jwt',
},
debug: process.env.NODE_ENV === "development",
debug: process.env.NODE_ENV === 'development',
providers: [
// @ts-expect-error
GoogleProvider.default({
Expand All @@ -34,10 +34,10 @@ export default NuxtAuthHandler({
},
},
events: {
createUser: async (message) => {
createUser: async message => {
await prisma.workspace.create({
data: {
name: "My workspace",
name: 'My workspace',
users: {
connect: {
id: message.user.id,
Expand Down

0 comments on commit cb35719

Please sign in to comment.