def generate_headers(self, token):
        """Generate auth headers"""
        headers = {}
        token = self.encode_token(token)
        if self.config["header"]:
            headers[self.config["header"]] = token
        if self.config["cookie"]:
            headers["Set-Cookie"] = dump_cookie(
                self.config["cookie"], token, httponly=True,
                max_age=self.config["expiration"]
            )
        return headers
def generate_headers ( self , token ) : headers = { } token = self . encode_token ( token ) if self . config [ "header" ] : headers [ self . config [ "header" ] ] = token if self . config [ "cookie" ] : headers [ "Set-Cookie" ] = dump_cookie ( self . config [ "cookie" ] , token , httponly = True , max_age = self . config [ "expiration" ] ) return headers
Generate auth headers