Skip to content

Commit

Permalink
Remove protectIdentities from the createAuth API (#4985)
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie authored Mar 3, 2021
1 parent a00a382 commit 490d52c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/honest-poems-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-next/auth': major
---

Removed `protectIdentities` from the `createAuth` arguments. The behaviour is now the same as having `protectIdentities: true`.
6 changes: 5 additions & 1 deletion packages-next/auth/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ import { initTemplate } from './templates/init';
export function createAuth<GeneratedListTypes extends BaseGeneratedListTypes>({
listKey,
secretField,
protectIdentities = true,
initFirstItem,
identityField,
magicAuthLink,
passwordResetLink,
}: AuthConfig<GeneratedListTypes>): Auth {
// The protectIdentities flag is currently under review to see whether it should be
// part of the createAuth API (in which case its use cases need to be documented and tested)
// or whether always being true is what we want, in which case we can refactor our code
// to match this. -TL
const protectIdentities = true;
const gqlNames: AuthGqlNames = {
CreateInitialInput: `CreateInitial${listKey}Input`,
createInitialItem: `createInitial${listKey}`,
Expand Down
2 changes: 0 additions & 2 deletions packages-next/auth/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ export type AuthConfig<GeneratedListTypes extends BaseGeneratedListTypes> = {
identityField: GeneratedListTypes['fields'];
/** The path of the field the secret is stored in; must be password-ish */
secretField: GeneratedListTypes['fields'];
/** Attempts to prevent consumers of the API from being able to determine the value of identity fields */
protectIdentities?: boolean;
/** Password reset link functionality */
passwordResetLink?: AuthTokenTypeConfig;
/** "Magic link" functionality */
Expand Down

1 comment on commit 490d52c

@vercel
Copy link

@vercel vercel bot commented on 490d52c Mar 3, 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.