简体   繁体   English

使用 aws-amplify 联合登录

[英]federatedSignIn with aws-amplify

I am using 'Auth' from aws-amplify to authenticate user.我正在使用 aws-amplify 中的“Auth”对用户进行身份验证。 But when I logged in successful with Google account using federatedSingIn.但是当我使用 federatedSingIn 使用 Google 帐户成功登录时。 I turn off wifi and turn on again, now Auth.currentAuthenticatedUser() return error 'no current user'.我关闭 wifi 并再次打开,现在 Auth.currentAuthenticatedUser() 返回错误“没有当前用户”。 I want to know that whether it is my bug in amplify configuration or it is a way Amplify works.我想知道这是我在放大配置中的错误还是 Amplify 的一种工作方式。 If it is my bug, please help me fix it, every suggestion is appreciated.如果这是我的错误,请帮助我修复它,感谢每一个建议。

Auth.currentAuthenticatedUser() behind the screen what it does is try to get aws-amplify-federatedInfo from local storage then return based on that.屏幕后面的Auth.currentAuthenticatedUser()它的作用是尝试从本地存储中获取aws-amplify-federatedInfo然后基于此返回。 Turning on or off your wifi have nothing to do with clearing your local storage.打开或关闭 wifi 与清除本地存储无关。

I have tried to re-produce it with my side project that also use Oauth from Google and Amplify.我试图用我的副项目重新制作它,该项目也使用来自 Google 和 Amplify 的 Oauth。 It doesn't go away or throw any error in console.它不会 go 消失或在控制台中抛出任何错误。 This probably have more to do with your local or other piece of code in your application这可能与您的应用程序中的本地或其他代码有更多关系

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM