[英]How to pass JS date to AWS Cognito DateTime using Amplify field
[英]How to get and pass deviceKey in social login using Cognito and AWS Amplify?
我試圖在社交登錄中使用Cognito中的函數setDeviceStatusRemembered
,但它需要一個deviceKey,它在返回的用戶對象中不可用。
該項目是使用React制作的。 我已經嘗試過StackOverflow和docs的一些回復,但沒有成功。
用戶由社交登錄中的OAuth通過OAuth處理和創建,登錄后,我將獲取用戶數據:
const cognitoUser = await Auth.currentAuthenticatedUser()
之后,對象cognitoUser
顯示deviceKey
null,如果我嘗試以下代碼,則會收到錯誤消息"1 validation error detected: Value null at 'deviceKey' failed to satisfy constraint: Member must not be null"
cognitoUser.setDeviceStatusRemembered({
onSuccess: function (result) {
console.log('call result: ' + result);
},
onFailure: function(err) {
console.log('call error', err);
}
})
我怎么解決這個問題? 我錯過了什么嗎? 謝謝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.