Fix api env variable usage

This commit is contained in:
2021-10-04 17:18:55 -05:00
parent cc44c409d7
commit d4e76486fc
3 changed files with 8 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
import React, { useEffect, useState } from "react";
import { useAuth0 } from "@auth0/auth0-react";
import config from "../config";
const ProfileFromApi = () => {
const { user, isAuthenticated, getAccessTokenSilently } = useAuth0();
@@ -9,12 +10,11 @@ const ProfileFromApi = () => {
const getMessage = async () => {
try {
const accessToken = await getAccessTokenSilently({
audience: "https://1t8da6s66e.execute-api.us-east-1.amazonaws.com/",
audience: config.auth0.audience,
scope: "read:stuff",
});
const authorizedUrl =
"https://1t8da6s66e.execute-api.us-east-1.amazonaws.com/authorized";
const authorizedUrl = `${config.domains.api}/test-authorized/`;
const authorizedResponse = await fetch(authorizedUrl, {
headers: {