Skip to content

Commit

Permalink
Fix remaining issues from broken commit
Browse files Browse the repository at this point in the history
  • Loading branch information
7dev7urandom committed Aug 29, 2024
1 parent 4b4e84a commit 25ec08f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
4 changes: 0 additions & 4 deletions source/SIL.AppBuilder.Portal/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { SvelteKitAuth, type DefaultSession, type SvelteKitAuthConfig } from '@a
import Auth0Provider from '@auth/sveltekit/providers/auth0';
import { redirect, type Handle } from '@sveltejs/kit';
import { DatabaseWrites, prisma } from 'sil.appbuilder.portal.common';
import { RoleId } from 'sil.appbuilder.portal.common/prisma';

declare module '@auth/sveltekit' {
interface Session {
Expand Down Expand Up @@ -43,12 +42,9 @@ const config: SvelteKitAuthConfig = {

// make sure to handle values that could change mid-session in both cases
// safest method is just handle such values in session below (see user.roles)
// user.isSuperAdmin is a special case handled here to give the /admin/jobs route
// access to see if the user has permission to see the BullMQ bull-board queue
if (!profile) return token;
const dbUser = await DatabaseWrites.users.getOrCreateUser(profile);
token.userId = dbUser.Id;
token.isSuperAdmin = !!dbUser.UserRoles.find((r) => r.RoleId === RoleId.SuperAdmin);
return token;
},
async session({ session, token }) {
Expand Down
7 changes: 0 additions & 7 deletions source/SIL.AppBuilder.Portal/src/lib/bullmq.ts

This file was deleted.

0 comments on commit 25ec08f

Please sign in to comment.