Skip to content

Commit 11b73b2

Browse files
committed
Various fixes and cleanup
1 parent efb6e5a commit 11b73b2

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

src/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ export const populateSecurityInfo: Handle = async ({ event, resolve }) => {
367367
'auth.user': user ? user.Email + ' - ' + user.Id : 'null',
368368
'auth.user.OrganizationMemberships':
369369
user?.OrganizationMemberships.map((o) => o.OrganizationId).join(', ') ?? 'null',
370-
'auth.user.roles': user ? JSON.stringify([...security.roles.entries()]) : 'null',
370+
'auth.user.roles': user ? JSON.stringify(security.roles) : 'null',
371371
'auth.user.IsLocked': user ? user.IsLocked + '' : 'null'
372372
});
373373

src/lib/utils/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ export function enumNumVals<E extends Record<string, string | number>>(e: E): nu
4343
return Object.values(e).filter((v) => !(typeof v === 'string'));
4444
}
4545

46-
export enum ServerStatus {
47-
Ok = 200,
48-
Forbidden = 403,
49-
NotFound = 404
50-
}
51-
5246
function pushToast(type: 'info' | 'success' | 'warning' | 'error', message: string) {
5347
toast.push(message, { pausable: true, classes: [type] });
5448
}

src/routes/(authenticated)/projects/[filter=projectSelector]/[[orgId=idNumber]]/+page.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { Prisma } from '@prisma/client';
2-
import { error } from '@sveltejs/kit';
2+
import { type Actions, error } from '@sveltejs/kit';
33
import { fail, superValidate } from 'sveltekit-superforms';
44
import { valibot } from 'sveltekit-superforms/adapters';
55
import * as v from 'valibot';
6-
import type { Actions, PageServerLoad } from './$types';
6+
import type { PageServerLoad } from './$types';
77
import { RoleId } from '$lib/prisma';
88
import { ProductActionType } from '$lib/products';
99
import { doProductAction } from '$lib/products/server';

src/routes/+layout.server.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ import type { LayoutServerLoad } from './$types';
22

33
export const load: LayoutServerLoad = async (event) => {
44
event.locals.security.requireNothing();
5-
const uData = await event.locals.auth();
6-
return { session: uData! };
5+
return { session: (await event.locals.auth())! };
76
};

0 commit comments

Comments
 (0)