How do I extend auth in adonis 4.1 to use a different hashing algorithm #1357
Unanswered
franciskisiara
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using adonis 4.1 but I have legacy express code that generated password hashes for users in the database. The hashes are stored using a different hashing algorithm compared to the one adonis uses.
I have created a custom
PapiHashSerializer
inapp/serializers
folder and attached it to the ioc as shown below. However, when I callHash.verify(password, hashed)
, I still get false. When I try to console.log anything in the validateCredentials() method in my serializer, I dont get any output so I was wondering when this method is triggered.On further investigation, I notice a typo, this method is actually defined as
validateCredentails()
instead ofvalidateCredentials()
in the Lucid serializer I am extending. NB ..tails instead of ...tials.This makes it very difficult to know whether I am heading the right direction or I am completely mistaken in extending auth to make Hash.verify() use a custom algorithm.
The PapiHashSerializer.js file
The start/hooks.js file
The config/auth.js file
Beta Was this translation helpful? Give feedback.
All reactions