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