title: AWS amplify currentAuthenticatedUser shows unauthenticated status even after doing federatedSignIn
body: <pre><code>export const requestFederatedSignOn = async (type) =&gt; {
      return new Promise((resolve, reject) =&gt; {
          Auth.federatedSignIn({ provider: type })
              .then(() =&gt; {
                  console.log(&quot;you have signed in&quot;);
                  authenticatedUserCred()
                      .then((userData) =&gt; {
                          console.log(&quot;you have been authenticated&quot;);
                          resolve(userData);
                      })
                      .catch((err) =&gt; console.error(err));
              })
              .catch((error) =&gt; reject(error));
      });
  };
  
  export const authenticatedUserCred = async () =&gt; {
      return new Promise((resolve, reject) =&gt; {
          Auth.currentAuthenticatedUser()
              .then((user) =&gt; {
                  const userAttributes = user.signInUserSession.idToken.payload;
                  const tokens = {
                      accessToken: user.signInUserSession.accessToken.jwtToken,
                      idToken: user.signInUserSession.idToken.jwtToken,
                      refreshToken: user.signInUserSession.refreshToken.token,
                  };
                  const userData = {
                      tokens: tokens,
                      userProfile: userAttributes,
                  };
                  resolve(userData);
              })
              .catch((err) =&gt; reject(err));
      });
  };
  
  </code></pre>
  <p>Basically, I am able to sign in using federatedSignIn and console log &quot;you have signed in&quot; is outputted but then authenticatedUserCred function for some reason is rejecting the promise. Please someone help me out!!!</p>