How to set cookie from flask to reactjs

@cross_origin(methods=['POST'], supports_credentials=True, headers=['Content-Type', 'Authorization'], origin='')
return jsonify({'response': response.json}), 200
return response, 200
def get_user():
    response = make_response('cookie being retrieved!')
    cookie = request.cookies.get('access_token')
    return jsonify({'cookie': cookie})
// for logging in a user
fetch('', {
                headers: {'Authorization': 'Basic ' + btoa(`${username}:${password}`)}, // the values of username and password variables are coming from a simple login form
                method: 'POST',
                mode: 'cors' // here we specify that the method is CORS meaning that the browser is allowed to make CORS requests
            .then(res => res)
            .then(data => console.log(data))

// for getting the cookies - testing
                fetch('', {
                method: 'GET',
                mode: 'cors',
                credentials: 'include' // includes cookies, authorization in request headers
            .then(res => res.json())
            .then(msg => console.log(msg))