{"action":"closed","issue":{"url":"https://api.github.com/repos/aws-amplify/amplify-js/issues/1268","repository_url":"https://api.github.com/repos/aws-amplify/amplify-js","labels_url":"https://api.github.com/repos/aws-amplify/amplify-js/issues/1268/labels{/name}","comments_url":"https://api.github.com/repos/aws-amplify/amplify-js/issues/1268/comments","events_url":"https://api.github.com/repos/aws-amplify/amplify-js/issues/1268/events","html_url":"https://github.com/aws-amplify/amplify-js/issues/1268","id":342549087,"node_id":"MDU6SXNzdWUzNDI1NDkwODc=","number":1268,"title":"Invalid refresh token with AWS amplify","user":{"login":"tarciosaraiva","id":893428,"node_id":"MDQ6VXNlcjg5MzQyOA==","avatar_url":"https://avatars2.githubusercontent.com/u/893428?v=4","gravatar_id":"","url":"https://api.github.com/users/tarciosaraiva","html_url":"https://github.com/tarciosaraiva","followers_url":"https://api.github.com/users/tarciosaraiva/followers","following_url":"https://api.github.com/users/tarciosaraiva/following{/other_user}","gists_url":"https://api.github.com/users/tarciosaraiva/gists{/gist_id}","starred_url":"https://api.github.com/users/tarciosaraiva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarciosaraiva/subscriptions","organizations_url":"https://api.github.com/users/tarciosaraiva/orgs","repos_url":"https://api.github.com/users/tarciosaraiva/repos","events_url":"https://api.github.com/users/tarciosaraiva/events{/privacy}","received_events_url":"https://api.github.com/users/tarciosaraiva/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-07-19T01:43:12Z","updated_at":"2018-07-24T21:40:34Z","closed_at":"2018-07-24T21:40:34Z","author_association":"NONE","body":"**Do you want to request a feature or report a bug?**\r\nReport a bug.\r\n\r\n**What is the current behavior?**\r\nUser logs in using `USER_PASSWORD_AUTH` authentication flow type, stays on the app for 1 hour. Moves on to another page on the app, a `POST` request to Cognito is issued to refresh the token and the response is HTTP 400.\r\n\r\nThe app invokes `Auth.currentAuthenticatedUser()` whenever moving between pages.\r\n\r\nRequest\r\n```\r\nPOST / HTTP/1.1\r\nHost: cognito-idp.ap-southeast-2.amazonaws.com\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0\r\nAccept: */*\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate, br\r\nReferer: http://localhost:3000/properties/9310\r\ncontent-type: application/x-amz-json-1.1\r\nx-amz-target: AWSCognitoIdentityProviderService.InitiateAuth\r\nx-amz-user-agent: aws-amplify/0.1.x js\r\norigin: http://localhost:3000\r\nContent-Length: 2051\r\nDNT: 1\r\nConnection: keep-alive\r\nPragma: no-cache\r\nCache-Control: no-cache\r\n```\r\n\r\nRequest POST data\r\n```\r\n{\r\n  \"ClientId\": \"xxx\",\r\n  \"AuthFlow\": \"REFRESH_TOKEN_AUTH\",\r\n  \"AuthParameters\": {\r\n    \"REFRESH_TOKEN\": \"...\",\r\n    \"DEVICE_KEY\": null\r\n  }\r\n}\r\n```\r\n\r\nResponse\r\n```\r\nHTTP/2.0 400 Bad Request\r\ndate: Thu, 19 Jul 2018 01:34:47 GMT\r\ncontent-type: application/x-amz-json-1.1\r\ncontent-length: 70\r\nx-amzn-requestid: ...\r\naccess-control-allow-origin: *\r\nx-amzn-errortype: NotAuthorizedException:\r\naccess-control-expose-headers: x-amzn-RequestId,x-amzn-ErrorType,x-amzn-ErrorMessage,Date\r\nx-amzn-errormessage: Invalid Refresh Token.\r\nX-Firefox-Spdy: h2\r\n```\r\n\r\n**What is the expected behavior?**\r\nExpected the session to be successfully refreshed.\r\n\r\n**Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions?**\r\nThe version of Amplify I'm using is `@aws-amplify/auth 1.0.0`. All browsers.\r\n"}}
{"actor":{"display_login":"tarciosaraiva"}}