From @jayair on Mon Apr 10 2017 01:04:36 GMT+0000 (UTC)
Link to chapter - http://serverless-stack.com/chapters/give-feedback-while-logging-in.html
Copied from original issue: https://github.com/AnomalyInnovations/serverless-stack-com/issues/43
Iām having an issue which has surfaced since I implemented the check for current session, my application throws an error when trying to check the session:
TypeError: Cannot read property 'currentSession' of undefined
Iāve checked the documentation on AWS Amplify but it seems to recommend different methods of doing the authentication, any idea where I may have gone wrong?
Does this happen when your app loads? Also, can you show me after which step in the tutorial does the problem show up?
Hey mate I worked out my issue just this morning, I had to recreate my user pool as the old one was causing issues the new one is working fine with identical setup
Great! Thanks for reporting back.
Hello!
First of all: Great tutorial! One of the best Iāve read so far.
I found a little bug tho, when you implement the loading state you donāt handle the incorrect username / password error so the button keeps spinning indefinetly.
How should we handle that?
Thank you so much!
Sorry I forgot a line when the login fails! I apologize
Thanks for reporting back.
Just wanted to say what a great tutorial this is. I have been going to a bootcamp and you are one of the additional resources that I use. Itās been great. Keep it up!!
Thatās awesome! Thanks for the kind words!
Hi,
Great tutorial so far, it would be a great addition in the guide to add how to handle incorrect details response. With the current code it only caters for a successful request. If it is incorrect the button does not handle unsuccessful request causing it to be disabled without being able to exit Logging in animation.
Yeah we definitely need to add more detail on that. Itāll most likely be an āextra creditā chapter, so we donāt overload first time readers.
Iām running into an issue that seems to be related to the rest operator (ā¦props) in the LoaderButton component. The error message is:
āTypeError: Cannot read property āforEachā of undefinedā
Removing the references to ā¦props does away with the error and so Iām able to work around the issue but Iām wondering what is causing it. Any ideas?
Thatās really weird! The spread operator is something pretty basic and should be handled by Create React App.
i agree and replaced what you have in Git and still get the same error.
@jayair , this is still not working and tried 3 times now. Going to disable this for the meantime but cant help but think that this could be related to a missing or old library because this happened in a previous chapter using the SPREAD OPERATOR.
Yeah this is super weird. I wonder if something is wrong with the setup on your machine. You should be able to use the spread operator by default.
So, after going through branch 40 (https://branchv40--serverless-stack.netlify.com/chapters/give-feedback-while-logging-in.html), I think I may have skipped a step in setting up my notes client previouslyā¦ Just dawned on me that my notes client install was done inside the notes API project folder folder rather than its own project folderā¦ I suspect thats what was causing my issueā¦ Everything is working great now! Did you happen to do the same?
As to the client project being a subdirectory of the server project, this was not my issue. I went through the tutorial again after the most recent version came out & didnāt run into this problem the second time around. Iām still curious as to why the spread operator would produce an error but it may have to remain a mystery.
The login flow works great when working locally (npm start) - Butā¦ when deployed to S3 (Iām hosting a static website / CDN etc) the following happens:
Load the app, press the Login button on the nav bar. Notice the URL changes to /login
now - hit the browser refresh button (command+R). Iām getting a AWS S3 Error XML message. the console shows that S3 returned 403 Forbidden.
Same flow on a local nodejs works great.
Any clue what is the root cause and how to solve this?