def generate_user_token ( self , user , salt = None ) : return self . token_serializer . dumps ( str ( user . id ) , salt = salt )
python using uuid as user token
Generates a unique token associated to the user
def generate_user_token(self, user, salt=None):
        """Generates a unique token associated to the user
        """
        return self.token_serializer.dumps(str(user.id), salt=salt)