Closed Alllex202 closed 1 month ago
Added extended authentication strategy specific to condo applications
Based on PasswordAuthStrategy from @keystonejs/auth-password
PasswordAuthStrategy
@keystonejs/auth-password
What are the differences with the main version?
These features are configurable via config
config
Example config:
{ // default props from "@keystonejs/auth-password" identityField: 'email', secretField: 'password', protectIdentities: true, // custom props findIdentityItems: async function (config, list, args) { const { identityField } = config const identity = args[identityField] return await list.adapter.find({ [identityField]: identity, }) }, }
in this pr a check for soft-deleted users was added to prepareKeystone
prepareKeystone
If you need to add your own checks for a specific app, you can do this by overriding findIdentityItems in this way:
findIdentityItems
prepareKeystone({ authStrategyOpts: { config: { findIdentityItems: async (config, list, args) => { const { identityField } = config const identity = args[identityField] return await list.adapter.find({ [identityField]: identity, deletedAt: null, }) } }, }, ...<other props> })
Issues 1 New issue 0 Accepted issues
Measures 0 Security Hotspots 0.0% Coverage on New Code 0.0% Duplication on New Code
See analysis details on SonarCloud
Added extended authentication strategy specific to condo applications
Based on
PasswordAuthStrategy
from@keystonejs/auth-password
What are the differences with the main version?
These features are configurable via
config
Example config:
in this pr a check for soft-deleted users was added to
prepareKeystone
If you need to add your own checks for a specific app, you can do this by overriding
findIdentityItems
in this way: