N-FIN-93: update session handling in actions

This commit is contained in:
Markus Thielker 2025-03-14 13:46:11 +01:00
parent e38157e604
commit 576c2b0c0c
8 changed files with 16 additions and 16 deletions

View file

@ -3,7 +3,7 @@ import { ActionResponse } from '@/lib/types/actionResponse';
import prisma from '@/prisma';
import { URL_SIGN_IN } from '@/lib/constants';
import { categoryFormSchema } from '@/lib/form-schemas/categoryFormSchema';
import { getSession } from '@auth0/nextjs-auth0';
import { auth0 } from '@/lib/auth';
export default async function categoryCreateUpdate({
id,
@ -12,7 +12,7 @@ export default async function categoryCreateUpdate({
}: z.infer<typeof categoryFormSchema>): Promise<ActionResponse> {
'use server';
const session = await getSession();
const session = await auth0.getSession();
if (!session) {
return {
type: 'error',

View file

@ -1,7 +1,7 @@
import { ActionResponse } from '@/lib/types/actionResponse';
import prisma from '@/prisma';
import { URL_SIGN_IN } from '@/lib/constants';
import { getSession } from '@auth0/nextjs-auth0';
import { auth0 } from '@/lib/auth';
export default async function categoryDelete(id: number): Promise<ActionResponse> {
'use server';
@ -14,7 +14,7 @@ export default async function categoryDelete(id: number): Promise<ActionResponse
};
}
const session = await getSession();
const session = await auth0.getSession();
if (!session) {
return {
type: 'error',

View file

@ -1,12 +1,12 @@
import { ActionResponse } from '@/lib/types/actionResponse';
import { URL_SIGN_IN } from '@/lib/constants';
import prisma from '@/prisma';
import { getSession } from '@auth0/nextjs-auth0';
import { auth0 } from '@/lib/auth';
export default async function clearAccountData(): Promise<ActionResponse> {
'use server';
const session = await getSession();
const session = await auth0.getSession();
if (!session) {
return {
type: 'error',

View file

@ -3,7 +3,7 @@ import { ActionResponse } from '@/lib/types/actionResponse';
import { entityFormSchema } from '@/lib/form-schemas/entityFormSchema';
import prisma from '@/prisma';
import { URL_SIGN_IN } from '@/lib/constants';
import { getSession } from '@auth0/nextjs-auth0';
import { auth0 } from '@/lib/auth';
export default async function entityCreateUpdate({
id,
@ -13,7 +13,7 @@ export default async function entityCreateUpdate({
}: z.infer<typeof entityFormSchema>): Promise<ActionResponse> {
'use server';
const session = await getSession();
const session = await auth0.getSession();
if (!session) {
return {
type: 'error',

View file

@ -1,7 +1,7 @@
import { ActionResponse } from '@/lib/types/actionResponse';
import prisma from '@/prisma';
import { URL_SIGN_IN } from '@/lib/constants';
import { getSession } from '@auth0/nextjs-auth0';
import { auth0 } from '@/lib/auth';
export default async function entityDelete(id: number): Promise<ActionResponse> {
'use server';
@ -14,7 +14,7 @@ export default async function entityDelete(id: number): Promise<ActionResponse>
};
}
const session = await getSession();
const session = await auth0.getSession();
if (!session) {
return {
type: 'error',

View file

@ -3,12 +3,12 @@ import type { Category, Entity } from '@prisma/client';
import { EntityType } from '@prisma/client';
import { URL_SIGN_IN } from '@/lib/constants';
import { ActionResponse } from '@/lib/types/actionResponse';
import { getSession } from '@auth0/nextjs-auth0';
import { auth0 } from '@/lib/auth';
export default async function generateSampleData(): Promise<ActionResponse> {
'use server';
const session = await getSession();
const session = await auth0.getSession();
if (!session) {
return {
type: 'error',

View file

@ -3,7 +3,7 @@ import { ActionResponse } from '@/lib/types/actionResponse';
import prisma from '@/prisma';
import { URL_SIGN_IN } from '@/lib/constants';
import { paymentFormSchema } from '@/lib/form-schemas/paymentFormSchema';
import { getSession } from '@auth0/nextjs-auth0';
import { auth0 } from '@/lib/auth';
export default async function paymentCreateUpdate({
id,
@ -16,7 +16,7 @@ export default async function paymentCreateUpdate({
}: z.infer<typeof paymentFormSchema>): Promise<ActionResponse> {
'use server';
const session = await getSession();
const session = await auth0.getSession();
if (!session) {
return {
type: 'error',

View file

@ -1,7 +1,7 @@
import { ActionResponse } from '@/lib/types/actionResponse';
import prisma from '@/prisma';
import { URL_SIGN_IN } from '@/lib/constants';
import { getSession } from '@auth0/nextjs-auth0';
import { auth0 } from '@/lib/auth';
export default async function paymentDelete(id: number): Promise<ActionResponse> {
'use server';
@ -14,7 +14,7 @@ export default async function paymentDelete(id: number): Promise<ActionResponse>
};
}
const session = await getSession();
const session = await auth0.getSession();
if (!session) {
return {
type: 'error',