Skip to content

Updated the getAuthObject method to get the current user's access_token #15

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Guiradi
Copy link

@Guiradi Guiradi commented Feb 5, 2020

Updated the getAuthObject method for fetch the current user's auth session data

@Guiradi Guiradi requested a review from vertcitron February 5, 2020 22:07
Copy link
Owner

@vertcitron vertcitron left a comment

Choose a reason for hiding this comment

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

Thank you for keeping alive this little piece!
As I ask further in a code comment, I just want to understand why a resolved promise with a null in place of a rejected promise with an ad-hoc message when not logged?

if (auth.isSignedIn.get()) {
return Promise.resolve(_formatAuthObject(auth.currentUser.get()))
} else {
return Promise.resolve(null)
Copy link
Owner

Choose a reason for hiding this comment

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

Is there a particular reason to return a null resolved promise in place of a rejected one with a not logged message?
A rejected promise should be more universal and more readable no?

Copy link

Choose a reason for hiding this comment

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

@vertcitron I'd say it is to remain consistent with the behavior of currentUser() defined below.

@vertcitron
Copy link
Owner

I merged a security fix on the upstream master, so if you change something on your PR, please rebase on it before.

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.

3 participants