Override method 'validateCredentails' in lucid serializer

I need to change the way it validates the password because I have a bank that uses another type of encryption, how to proceed in this case?

this method:

// path: @adonisjs/auth/src/Serializers/Lucid
async validateCredentails (user, password) {
    if (!user || !user[this._config.password]) {
      return false
    }
    // change 'this.Hash.verify' to my verification mode
    return this.Hash.verify(password, user[this._config.password])
  }

You can create a custom middleware for your authentication type… No need to use the default one

1 Like

Thanks @un-versed, I ended up having to do that

1 Like