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

Add getTokenStatus method #838

Merged
merged 21 commits into from
Apr 13, 2019
Merged

Add getTokenStatus method #838

merged 21 commits into from
Apr 13, 2019

Conversation

Aliandi
Copy link
Contributor

@Aliandi Aliandi commented Mar 26, 2019

Fixes #787

Description

As requested in the mentioned issue, the method getTokenStatus was added to the BotFrameworkAdapter class, using the logic that already existed in the userToken class.

Specific Changes

  • Add TokenStatus to the index.ts file
  • Port GetTokenStatusAsync from C# to TypeScript (as getTokenStatus).
  • Add tests for the new method

Testing

imagen

@coveralls
Copy link

coveralls commented Mar 26, 2019

Pull Request Test Coverage Report for Build #2183

  • 8 of 8 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.7%) to 88.302%

Totals Coverage Status
Change from base Build #2182: 0.7%
Covered Lines: 3234
Relevant Lines: 3520

💛 - Coveralls

throw new Error(`BotFrameworkAdapter.getTokenStatus(): missing from or from.id`);
}
this.checkEmulatingOAuthCards(context);
! userId? userId = context.activity.from.id : userId;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you use a more traditional if on this, the !userId? is a confusing bit of syntax for humans.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! Syntax updated 😄

@Aliandi Aliandi requested a review from benbrown March 27, 2019 22:24
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.

UserToken flow not exposed in BotFrameworkAdapter
5 participants