fix auth session
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
"lodash.debounce": "^4.0.8",
|
||||
"lodash.throttle": "^4.1.1",
|
||||
"lottie-react": "^2.4.0",
|
||||
"lucide-react": "^0.323.0",
|
||||
"lucide-react": "^0.331.0",
|
||||
"mathjs": "^12.3.2",
|
||||
"mitt": "^3.0.1",
|
||||
"next": "~14.0.4",
|
||||
|
||||
@@ -2,13 +2,10 @@ import { useEffect, useState } from 'react';
|
||||
import { api } from '@/app/_trpc/client';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Checkbox } from '@/components/ui/checkbox';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import {
|
||||
Sheet,
|
||||
SheetClose,
|
||||
SheetContent,
|
||||
SheetDescription,
|
||||
SheetFooter,
|
||||
SheetHeader,
|
||||
SheetTitle,
|
||||
@@ -18,7 +15,7 @@ import { cn } from '@/utils/cn';
|
||||
import type { VariantProps } from 'class-variance-authority';
|
||||
import { cva } from 'class-variance-authority';
|
||||
import type { LucideIcon } from 'lucide-react';
|
||||
import { ActivityIcon, BotIcon, DotIcon, MonitorPlayIcon } from 'lucide-react';
|
||||
import * as Icons from 'lucide-react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
@@ -65,9 +62,20 @@ const records: Record<
|
||||
};
|
||||
|
||||
const icons: Record<string, LucideIcon> = {
|
||||
BotIcon,
|
||||
MonitorPlayIcon,
|
||||
ActivityIcon,
|
||||
DownloadIcon: Icons.DownloadIcon,
|
||||
BotIcon: Icons.BotIcon,
|
||||
BoxIcon: Icons.BoxIcon,
|
||||
AccessibilityIcon: Icons.AccessibilityIcon,
|
||||
ActivityIcon: Icons.ActivityIcon,
|
||||
AirplayIcon: Icons.AirplayIcon,
|
||||
AlarmCheckIcon: Icons.AlarmCheckIcon,
|
||||
AlertTriangleIcon: Icons.AlertTriangleIcon,
|
||||
BellIcon: Icons.BellIcon,
|
||||
BoltIcon: Icons.BoltIcon,
|
||||
CandyIcon: Icons.CandyIcon,
|
||||
ConeIcon: Icons.ConeIcon,
|
||||
MonitorPlayIcon: Icons.MonitorPlayIcon,
|
||||
PizzaIcon: Icons.PizzaIcon,
|
||||
};
|
||||
|
||||
const colors = [
|
||||
@@ -133,6 +141,7 @@ export function EventIcon({
|
||||
|
||||
const mutation = api.event.updateEventMeta.useMutation({
|
||||
onSuccess() {
|
||||
// @ts-expect-error
|
||||
document.querySelector('#close-sheet')?.click();
|
||||
toast('Event updated');
|
||||
router.refresh();
|
||||
|
||||
@@ -8,14 +8,20 @@ const handler = (req: Request) =>
|
||||
req,
|
||||
router: appRouter,
|
||||
createContext: () => {
|
||||
console.log('------- createContext --------');
|
||||
const session = auth();
|
||||
console.log('session', session);
|
||||
console.log('session', JSON.stringify(session, null, 2));
|
||||
|
||||
return {
|
||||
session: auth(),
|
||||
session,
|
||||
};
|
||||
},
|
||||
onError(opts) {
|
||||
const { error, type, path, input, ctx, req } = opts;
|
||||
console.error('---- TRPC ERROR');
|
||||
console.error('Error:', error);
|
||||
console.error('Context:', ctx);
|
||||
console.error();
|
||||
},
|
||||
});
|
||||
|
||||
12
pnpm-lock.yaml
generated
12
pnpm-lock.yaml
generated
@@ -435,8 +435,8 @@ importers:
|
||||
specifier: ^2.4.0
|
||||
version: 2.4.0(react-dom@18.2.0)(react@18.2.0)
|
||||
lucide-react:
|
||||
specifier: ^0.323.0
|
||||
version: 0.323.0(react@18.2.0)
|
||||
specifier: ^0.331.0
|
||||
version: 0.331.0(react@18.2.0)
|
||||
mathjs:
|
||||
specifier: ^12.3.2
|
||||
version: 12.3.2
|
||||
@@ -12256,6 +12256,14 @@ packages:
|
||||
react: 18.2.0
|
||||
dev: false
|
||||
|
||||
/lucide-react@0.331.0(react@18.2.0):
|
||||
resolution: {integrity: sha512-CHFJ0ve9vaZ7bB2VRAl27SlX1ELh6pfNC0jS96qGpPEEzLkLDGq4pDBFU8RhOoRMqsjXqTzLm9U6bZ1OcIHq7Q==}
|
||||
peerDependencies:
|
||||
react: ^16.5.1 || ^17.0.0 || ^18.0.0
|
||||
dependencies:
|
||||
react: 18.2.0
|
||||
dev: false
|
||||
|
||||
/luxon@3.4.4:
|
||||
resolution: {integrity: sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
Reference in New Issue
Block a user