First time poster. Have been working through "The ...
# help
r
First time poster. Have been working through "The Basics" Guide and getting caught up on the "Adding Auth to a React app" Section -- specifically https://serverless-stack.com/chapters/create-a-login-page.html Running into an “Authentication Failed” alert while attempting to actually log into the admin@example.com user we create earlier on in the tutorial. (see screenshot) Branch repo: https://github.com/rd-demos/demo-notes-app/tree/adding-auth-to-a-react-app Also created a discourse comment with some more verbose details: https://discourse.serverless-stack.com/t/login-with-aws-cognito/129/70?u=rdhrty Was curious to see if anyone else had run into this previously / had any thoughts on what I may have missed here / bungled up with my Frontend/Auth stack set up or Amplify set up. Thanks for any insight!
d
The configuration object is missing required auth properties
This part of the error implies an problem with this section - https://serverless-stack.com/chapters/configure-aws-amplify.html#add-aws-amplify - have you configured the
Auth
part of the config, and have the values resolved properly? If you
console.log
that
Auth
part, you should see your cognito values in there, like the user pool ID etc.
r
Ah... Yes, seems like all of those values are getting returned as
undefined
when I
console.log
that out via the catch clause in
Login.js
... I am however seeing those values populate in the output from
npx sst start
(
REACT_APP_API_URL
,
REACT_APP_USER_POOL_ID
) -- so I'm curious if I've done something wrong with the
config.js
file we create in that step, since it doesn't seem to be resolving those env values correctly for the React app.
d
Did you do this part 🙂 this is what takes the variables from SST (which you’re seeing in the console), and makes them available to the react development server - https://serverless-stack.com/chapters/create-a-new-reactjs-app.html#loading-sst-environment-variables
r
🙈 🙈 🙈 re-generated the frontend directory at some point while troubleshooting another issue and forgot to change the
package.json
to include
sst-env
THANK YOU @Dan Greaves! 😂
d
Haha all good, easy to miss little things like that!