Closed lerickson-control4 closed 4 years ago
createAdminAuthModule
it's for creating auth module, to create core you need to use createAdminCoreModule
instead of create
.
I have issue with
import { CredentialValidatorProvider } from 'nestjs-admin'
too..
The TS say me:
Module '"../../node_modules/nestjs-admin/dist/src"' has no exported member 'CredentialValidatorProvider'.
@williamdclt can you tell us please how to get that provider?
@lerickson-control4 good news for us. I have found the sample with using the Validator of admin login. See here: https://github.com/Theodo-UK/nestjs-admin/blob/master/exampleApp/src/user/userCredentialValidator.ts
We mustn't use the CredentialValidatorProvider in the new way to do this.
This is solution.
Thank you @ishpartko for your PR! The docs are indeed somehow outdated, I do realise this is confusing and annoying. I struggle to find the time to maintain this library as well as it deserves, sadly. Hopefully it'll get better!
I am trying to follow the guide here: https://nestjs-admin.com/docs/custom-authentication, for providing custom authentication for the
nestjs-admin
app. There are a couple of issues with the docs and/or the code that I don't understand.FIrst, there is no static method
create()
on theAdminAuthModuleFactory
class. Rather, it'screateAdminAuthModule()
, but that method does not allow provisioning acredentialProvider
property through the factory as per the docs. The type accepted by that call only allowsadminCoreModule
, not an instance ofAdminAuthModuleConfig
.Second, assuming I could get past the first issue, the
CredentialValidatorProvider
type does not appear to be exported fromnestjs-amin
, at least not from the top-levelindex
. So just creating the validator doesn't work either. Also, theAdminAuthModuleConfig
interface is not exported at all, so I'm not sure how that type gets exposed either.Short of tweaking the credential provider a little I haven't strayed very far from the docs at all. Is there something I'm missing here? Using version 0.3.0.
Here is the error output: