Closed Xstoudi closed 3 years ago
+1
An application may need to do authentication without having a database. In that case, it will have a custom auth provider, which doesn't need Lucid.
In theory yes. But I am not sure, if it is pragmatic or not. Even the node ace invoke
command cannot configure the package for you, coz it forces you to choose between "Database" and "Lucid" for looking up users.
In short, I am trying to understand what are we trying to fix it and how many applications we have observed using this package without Lucid
It's not only in theory, it's a practical problem we had while using @adonisjs/auth
without Lucid.
I may have opened this PR too fast considering that we need to install Lucid anyway if we want to use it but this is what I suggest :
@adonisjs/lucid
peer depnode ace invoke
(that doesn't install Lucid)If this solution seems ok to you, I can push on this branch.
I am just trying to understand the actual issue. So please bear with me :)
If I get it right. The issue is, you received an error, because you were installing @adonisjs/auth
before @adonisjs/lucid
. But you will still use Lucid?
Or is it, you don't want to use Lucid at all and because of the peer dependency, you are not able to install auth package?
No problem. We don't want to use Lucid at all and because of the peer dependency, we are not able to install auth package.
Okay that makes sense. We can mark the peer dependency optional.
Is the PR I made enough or you need me to make another change?
It is good. Thanks 🙂
Proposed changes
Make @adonisjs/lucid peer dependency as optional.
Types of changes
Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
Without the change, installing
@adonisjs/auth
cause an error if@adonisjs/lucid
is not installed.