Implementing a localAuth authPlugin from scratch