Open
Description
Before opening, please confirm:
- I have searched for duplicate or closed issues and discussions.
- I have read the guide for submitting bug reports.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
JavaScript Framework
Angular
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
None
Environment information
# Put output below this line
Describe the bug
If there ever was a reason not to documented code here it is.
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import { Amplify } from '../Amplify';
import { AuthSession, FetchAuthSessionOptions } from '../Auth/types';
import { fetchAuthSession as fetchAuthSessionInternal } from './internal/fetchAuthSession';
/**
* Fetch the auth session including the tokens and credentials if they are available. By default it
* does not refresh the auth tokens or credentials if they are loaded in storage already. You can force a refresh
* with `{ forceRefresh: true }` input.
*
* @param options - Options configuring the fetch behavior.
* @throws {@link AuthError} - Throws error when session information cannot be refreshed.
* @returns Promise<AuthSession>
*/
export const fetchAuthSession = (
options?: FetchAuthSessionOptions,
): Promise<AuthSession> => {
return fetchAuthSessionInternal(Amplify, options);
};
Expected behavior
Keep it consistent. We're now not sure of expired tokens are being refreshed withotu the force flag.
Reproduction steps
N/A
Code Snippet
// Put your code below this line.
Log output
// Put your logs below this line
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response