sst.dev icon indicating copy to clipboard operation
sst.dev copied to clipboard

Please include social login examples also

Open yashg5 opened this issue 9 years ago • 6 comments

Facebook and google login and how to store them in user pool. it would be lot helpful. I am not able to find good examples anywhere to work on. If you have any external examples for the same please provide

yashg5 avatar Jul 17 '17 07:07 yashg5

@yashg5 With the current set up we have, it is a little tricky to add Facebook and Google. The new update that we are making to the tutorial will make this easier to do. Stay tuned! - https://github.com/AnomalyInnovations/serverless-stack-com/issues/108

jayair avatar Jul 18 '17 16:07 jayair

Hi,

I already did the facebook login, i just want to asked, how to handle session using facebook login? What i mean is that when i refreshed the page, it will maintain the session state of the current user.

sanjosedennis7593 avatar Oct 25 '17 06:10 sanjosedennis7593

@sanjosedennis7593 Are you using the FB SDK?

jayair avatar Oct 25 '17 17:10 jayair

Yes, i'm using FB SDK, once i logged in, i get the credentials using the AWS.config.credentials, unfortunately, when i tried to refresh the page, it clears the value in the AWS.config.credentials object.

sanjosedennis7593 avatar Oct 26 '17 06:10 sanjosedennis7593

This is true even for our current tutorial. We call authUser every time the page is refreshed - https://github.com/AnomalyInnovations/serverless-stack-demo-client/blob/master/src/App.js#L21.

I think you'll need to do the same for FB. Check if the user is logged in using FB when the page loads and get a set of temporary credentials.

jayair avatar Oct 26 '17 17:10 jayair

@sanjosedennis7593 can you share your code? I am also block by AWS.config.credentials.getPromise() not waiting to resolve or alway undefined (not async) in any case could this help: https://github.com/aws/aws-sdk-js/issues/1097

please share if your successful...

jatazoulja avatar Feb 09 '18 13:02 jatazoulja