Skip to content

Commit

Permalink
chore: Export fetchAuthSession input & output types (#13037)
Browse files Browse the repository at this point in the history
* chore: Export featchAuthSession input & output types.

* Specify return type on main API.

* PR tweaks.
  • Loading branch information
jimblanc committed Feb 29, 2024
1 parent f049a9e commit 7a8ec81
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/auth/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ export { AuthError } from './errors/AuthError';

export {
fetchAuthSession,
FetchAuthSessionOptions,
AuthSession,
decodeJWT,
CredentialsAndIdentityIdProvider,
GetCredentialsOptions,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export {
TokenProvider,
AuthTokens,
FetchAuthSessionOptions,
AuthSession,
CredentialsAndIdentityIdProvider,
CredentialsAndIdentityId,
Identity,
Expand Down
6 changes: 4 additions & 2 deletions packages/core/src/singleton/apis/fetchAuthSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
// SPDX-License-Identifier: Apache-2.0

import { Amplify } from '../Amplify';
import { FetchAuthSessionOptions } from '../Auth/types';
import { AuthSession, FetchAuthSessionOptions } from '../Auth/types';

import { fetchAuthSession as fetchAuthSessionInternal } from './internal/fetchAuthSession';

export const fetchAuthSession = (options?: FetchAuthSessionOptions) => {
export const fetchAuthSession = (
options?: FetchAuthSessionOptions,
): Promise<AuthSession> => {
return fetchAuthSessionInternal(Amplify, options);
};

0 comments on commit 7a8ec81

Please sign in to comment.