Skip to content

Commit

Permalink
refactor: Remove unused code and imports in backend files
Browse files Browse the repository at this point in the history
  • Loading branch information
relusion committed Sep 8, 2024
1 parent dd867bf commit eea2457
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/custom-session-az-swa/backend/keystone.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { config } from '@keystone-6/core'
import { lists } from './schema'
import type { Context, TypeInfo } from '.keystone/types'
import type { TypeInfo } from '.keystone/types'
import { AzStaticWebAppAuthSessionStrategy } from './session'

export default config<TypeInfo>({
Expand Down
6 changes: 1 addition & 5 deletions examples/custom-session-az-swa/backend/schema.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { list } from "@keystone-6/core";
import { allOperations, allowAll, denyAll, unfiltered } from "@keystone-6/core/access";
import { unfiltered } from "@keystone-6/core/access";
import { checkbox, text } from "@keystone-6/core/fields";
import type { Lists } from ".keystone/types";
import RoleNames, { hasRole, SwaClientPrincipal } from "./session";

function hasSession({ session }: { session?: SwaClientPrincipal }) {
return Boolean(session);
}

function isAdmin({ session }: { session?: SwaClientPrincipal }) {
if (!session) return false;
return hasRole({ session }, RoleNames.Admin);
Expand Down

0 comments on commit eea2457

Please sign in to comment.