def get_auth_token(self): """Get token that can be used to authenticate a user.""" return token.generate(self.id, 'users')
def get_token(self): return token.generate(self.mail.data, namespace='preterm')