Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Export fetchAuthSession input & output types #13037

Merged
merged 9 commits into from
Feb 29, 2024

Conversation

jimblanc
Copy link
Contributor

Description of changes

Export the fetchAuthSession input & output types from aws-amplify/auth, in line with our other v6 APIs.

Issue #, if available

Description of how you validated changes

Local testing

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jimblanc jimblanc marked this pull request as ready for review February 27, 2024 16:20
@jimblanc jimblanc requested review from a team as code owners February 27, 2024 16:20
export const fetchAuthSession = (options?: FetchAuthSessionOptions) => {
export const fetchAuthSession = (
options?: FetchAuthSessionOptions,
): Promise<AuthSession> => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the return type here more explicit

Copy link
Contributor

@ashika112 ashika112 Feb 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we confirm is there is a test for this use case also probably type those too? What are your thoughts?

@jxdp
Copy link
Contributor

jxdp commented Feb 27, 2024

The Amplify Auth package has come a long way with the V6 upgrade, it's great to see.

For the sake of consistency, perhaps this PR should also add a FetchAuthSessionOutput = AuthSession alias so that it is consistent with the other methods, such as

  • getCurrentUser with GetCurrentUserOutput (= AuthUser)
  • fetchUserAttributes with FetchUserAttributesOutput (= AuthUserAttributes<UserAttributeKey>)

Perhaps AuthUserAttributes could also be exported (since UseAttributeKeys already is).

@jimblanc jimblanc merged commit 7a8ec81 into aws-amplify:main Feb 29, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants