Implements auth using JWT