Modify new_token and digest method to use self instead of User