Skip to content

Commit

Permalink
Fix isAccessAllowed default (#4923)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown authored Feb 23, 2021
1 parent 739cf34 commit 1c5a399
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/eighty-lies-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@keystone-next/admin-ui': major
'@keystone-next/keystone': major
---

Fixed isAccessAllowed default so that if a session strategy is not used, access is always allowed to the Admin UI rather than never allowing access
4 changes: 3 additions & 1 deletion packages-next/admin-ui/src/system/createAdminUIServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export const createAdminUIServer = async (
});
const isValidSession = ui?.isAccessAllowed
? await ui.isAccessAllowed(context)
: context.session !== undefined;
: sessionStrategy
? context.session !== undefined
: true;
const maybeRedirect = await ui?.pageMiddleware?.({
req,
session: context.session,
Expand Down

1 comment on commit 1c5a399

@vercel
Copy link

@vercel vercel bot commented on 1c5a399 Feb 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.