-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't use AUTH_TYPE.AMAZON_COGNITO_USER_POOLS in config - window is not defined #1
Comments
Did a little research and it look's like some updates to aws-amplify haven't been pushed yet to a new version. Did |
@lolcoolkat ver interesting, thanks for pointing this out. I'll check into this and see what we can do :) |
Btw @dabit3 doing the following doesn't work on the server with SSR...
So instead of using that function.. I figured i'll just get the accessToken I need manually and pass that directly to the AWSAppSyncClient.. First thing that needs to change is in the AWS Amplify config adding the cookieStorage settings like so:
We need to extract the accessToken from the cookies..and pass that to the AppSync client. I'm using the following function to extract it out.. The actual thing we are trying to extract looks like this:
and calling it like so when initializing Apollo:
This solution seems to be working... but hopefully a solution by aws amplify for supporting SSR would be nice in the future. I made an issue thread here awhile back before I explored this solution: aws-amplify/amplify-js#951 |
Ok @lolcoolkat I just checked on this and it seems to be an issue with the current implementation of AWS Amplify. This issue is already being tracked as a future enhancement and will be fixed in Amplify in the near future. I'll leave this open to others looking to use this and possibly use your workaround, and will update as soon as it's fixed in the main AWS Amplify SDK. Thanks for pointing this out! |
Did this get fixed? |
wondering if this is fixed as well. |
@dabit3 Is there a place where we can see tracking on this in Amplify? |
@dabit3 any news on this front? Please let us know! |
@lolcoolkat thanks for sharing your solution. Can you please tell how you placed |
@lolcoolkat do you also tweaking |
To the best of my knowledge this is on the roadmap but there is no specific date yet set for it. For better visibility, consider posting the same issue in the Amplify JS repo, from there the team should be able to give more info than I have. https://github.com/aws-amplify/amplify-js/issues |
These are some related issues in amplify-js I consider the lack of support for SSR in Amplify to be a terrible oversight. Particularly because SSR works for most of the components, so it lures you into a false sense of security -- but if Auth doesn't work properly, then the entire framework is useless. The worst part is that the error is silent, so I don't even know where to begin debugging the issue or offering a patch. If this is an issue for you, please be vocal on the amplify github issues section because they are responsive to feedback. |
I know there was this issue awhile back.. but I can't use the following in my config..
It gives the following error: UnhandledPromiseRejectionWarning: ReferenceError: window is not defined
Look's like the error has been addressed here: aws-amplify/amplify-js#882 Is there nothing we can do until this bug is fixed?
The text was updated successfully, but these errors were encountered: