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

feat: use User class defined in auth0-spa-js #236

Merged
merged 3 commits into from
May 5, 2021

Conversation

tkiryu
Copy link
Contributor

@tkiryu tkiryu commented May 2, 2021

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

This PR is a proposal for using User class defined in auth0-spa-js instead of existing User type of any.

- export type User = any;
+ import { User } from '@auth0/auth0-spa-js';

export interface AuthState<TUser extends User = User> {
  error?: Error;
  isAuthenticated: boolean;
  isLoading: boolean;
  user?: TUser;
}

I think that this PR would enhance #233 and be more convenient for us to get a correct user type without passing type parameter.

References

#233

Testing

I passed unit test and checked the behavior in the cra example.

  • This change adds test coverage fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

@tkiryu tkiryu requested a review from a team as a code owner May 2, 2021 13:30
Copy link
Contributor

@adamjmcgrath adamjmcgrath left a comment

Choose a reason for hiding this comment

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

lgtm - thanks @tkiryu

@adamjmcgrath adamjmcgrath merged commit 9a15c54 into auth0:master May 5, 2021
@adamjmcgrath adamjmcgrath mentioned this pull request May 5, 2021
@tkiryu
Copy link
Contributor Author

tkiryu commented May 5, 2021

@adamjmcgrath Thanks for merging. Much appreciated!

aaronadamsCA pushed a commit to aaronadamsCA/auth0-react that referenced this pull request May 5, 2021
* feat: use User class defined in auth0-spa-js

* feat: export User class

* fix: test

Co-authored-by: Tatsushi Kiryu <[email protected]>
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

2 participants