npm run build durch gelaufen
This commit is contained in:
parent
aec4b93439
commit
02bb2ed994
|
|
@ -33,6 +33,7 @@ RUN pnpm --filter @innungsapp/shared prisma:generate
|
|||
|
||||
# Build the admin app
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV DOCKER_BUILD=1
|
||||
RUN pnpm --filter @innungsapp/admin build
|
||||
|
||||
# =============================================
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ const createOrgSchema = z.object({
|
|||
landingPageHeroImage: z.string().optional().nullable(),
|
||||
landingPageHeroOverlayOpacity: z.number().min(0).max(100).optional().default(50),
|
||||
landingPageFeatures: z.string().optional(),
|
||||
landingPageFooter: z.string().optional(),
|
||||
landingPageSectionTitle: z.string().optional(),
|
||||
landingPageButtonText: z.string().optional(),
|
||||
appStoreUrl: z.string().url('Ungueltige URL').optional().or(z.literal('')),
|
||||
|
|
@ -90,6 +91,7 @@ const updateOrgSchema = z.object({
|
|||
landingPageText: z.string().optional(),
|
||||
landingPageHeroImage: z.string().optional().nullable(),
|
||||
landingPageFeatures: z.string().optional(),
|
||||
landingPageFooter: z.string().optional(),
|
||||
landingPageSectionTitle: z.string().optional(),
|
||||
landingPageButtonText: z.string().optional(),
|
||||
appStoreUrl: z.string().url('Ungueltige URL').optional().or(z.literal('')),
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ export default async function LandingPagesOverview({
|
|||
const organizations = await prisma.organization.findMany({
|
||||
where: q ? {
|
||||
OR: [
|
||||
{ name: { contains: q, mode: 'insensitive' } },
|
||||
{ slug: { contains: q, mode: 'insensitive' } },
|
||||
{ name: { contains: q } },
|
||||
{ slug: { contains: q } },
|
||||
]
|
||||
} : {},
|
||||
orderBy: { name: 'asc' },
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@ export default async function SuperAdminPage({
|
|||
const where = q
|
||||
? {
|
||||
OR: [
|
||||
{ name: { contains: q, mode: 'insensitive' } },
|
||||
{ slug: { contains: q, mode: 'insensitive' } },
|
||||
{ contactEmail: { contains: q, mode: 'insensitive' } },
|
||||
{ name: { contains: q } },
|
||||
{ slug: { contains: q } },
|
||||
{ contactEmail: { contains: q } },
|
||||
],
|
||||
}
|
||||
: {}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import type { NextConfig } from 'next'
|
|||
|
||||
const nextConfig: NextConfig = {
|
||||
transpilePackages: ['@innungsapp/shared'],
|
||||
output: 'standalone',
|
||||
output: process.env.DOCKER_BUILD ? 'standalone' : undefined,
|
||||
experimental: {},
|
||||
webpack: (config, { dev }) => {
|
||||
if (dev) {
|
||||
|
|
|
|||
|
|
@ -41,17 +41,7 @@ async function createUserDirectly(opts: { email: string; name: string; password:
|
|||
mustChangePassword: opts.mustChangePassword ?? false,
|
||||
},
|
||||
})
|
||||
// Try better-auth API first (guaranteed correct hash format).
|
||||
// Falls back to direct DB write if API fails (e.g. admin permissions not available).
|
||||
try {
|
||||
const authHeaders = await getSanitizedHeaders()
|
||||
await auth.api.updateUser({
|
||||
body: { userId, password: opts.password },
|
||||
headers: authHeaders,
|
||||
})
|
||||
} catch {
|
||||
await createCredentialAccount(userId, opts.password)
|
||||
}
|
||||
await createCredentialAccount(userId, opts.password)
|
||||
return { id: userId }
|
||||
}
|
||||
|
||||
|
|
@ -148,8 +138,8 @@ export const membersRouter = router({
|
|||
if (callerHasAccess) {
|
||||
const ur = memberAnyOrg.userId
|
||||
? await ctx.prisma.userRole.findUnique({
|
||||
where: { orgId_userId: { orgId: memberAnyOrg.orgId, userId: memberAnyOrg.userId } }
|
||||
})
|
||||
where: { orgId_userId: { orgId: memberAnyOrg.orgId, userId: memberAnyOrg.userId } }
|
||||
})
|
||||
: null
|
||||
return { ...memberAnyOrg, role: ur?.role ?? 'member' }
|
||||
}
|
||||
|
|
@ -226,7 +216,7 @@ export const membersRouter = router({
|
|||
|
||||
// 1. Create the member record
|
||||
const member = await ctx.prisma.member.create({
|
||||
data: { ...rest, orgId: ctx.orgId },
|
||||
data: { ...rest, orgId: ctx.orgId } as any,
|
||||
})
|
||||
|
||||
// 2. Create a User account if a password was provided OR role is 'admin',
|
||||
|
|
@ -256,8 +246,9 @@ export const membersRouter = router({
|
|||
where: { userId, providerId: 'credential' }
|
||||
})
|
||||
if (credAccount) {
|
||||
// Credential account exists — update the password via Better Auth
|
||||
await auth.api.updateUser({ body: { userId, password, name: input.name }, headers: authHeaders })
|
||||
// Credential account exists — update the password hash directly
|
||||
const newHash = await hashPassword(password)
|
||||
await ctx.prisma.account.update({ where: { id: credAccount.id }, data: { password: newHash } })
|
||||
} else {
|
||||
// No credential account yet — create one directly in the DB
|
||||
await createCredentialAccount(userId, password)
|
||||
|
|
@ -292,7 +283,7 @@ export const membersRouter = router({
|
|||
|
||||
// 1. Create member record
|
||||
const member = await ctx.prisma.member.create({
|
||||
data: { ...memberData, orgId: ctx.orgId },
|
||||
data: { ...memberData, orgId: ctx.orgId } as any,
|
||||
})
|
||||
|
||||
const org = await ctx.prisma.organization.findUniqueOrThrow({
|
||||
|
|
|
|||
Loading…
Reference in New Issue