This is what I have done:
I added a .env
file on the root Level:
REACT_APP_AZURE_ACTIVE_DIRECTORY_APP_CLIENT_ID = (Client ID)
Then I added three files under src
subfolder.
Then I changed the code of app.tsx
to a new one as I was asked.
I don't change anythings in project. Just paste client_id into .env
file.
And I also follow the offical doc, create app regidtration, add spa and so on.
My test steps:
Download sample peoject code from the link you provided.
Open it by vscode, run cmd npm i
.
Copy and paste clientid into .env
file.
Then excute cmd npm run start
. It works fine.
I was also following the MS tutorial and encountered the same problem. What I needed to do was:
npm i
(I don't now if this step is needed)npm run start
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.