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

login_client improvements #12

Merged
merged 8 commits into from
Jan 7, 2021
Merged

login_client improvements #12

merged 8 commits into from
Jan 7, 2021

Conversation

Albert221
Copy link
Member

@Albert221 Albert221 commented Jan 7, 2021

After using this library in a production app, there were few issues discovered. This Pull Request fixes them.

Also, I went back to the onCredentialsChanged stream in the LoginClient class as it was in the 0.* versions of the login_client library. It's just much easier for the developer and cleaner to use stream instead of passing a callback that the developer would have to prospectively somehow reach from other parts of the code.

login_client

  • OAuth2 clientId and clientSecret now default to an empty string.
  • Export oauth2 Credentials, AuthorizationException and ExpirationException.
  • Add onCredentialsChanged stream to LoginClient.
  • Deprecate credentialsChangedCallback.

login_client_flutter

  • Fix reading null credentials.

Closes #11.

@Albert221 Albert221 added enhancement New feature or request p: login_client Related to the login_client package p: login_client_flutter Related to the login_client_flutter package labels Jan 7, 2021
@Albert221 Albert221 changed the title login_client after-use improvements login_client improvements Jan 7, 2021
@codecov
Copy link

codecov bot commented Jan 7, 2021

Codecov Report

Merging #12 (ca18f96) into master (9a4a3ea) will decrease coverage by 27.18%.
The diff coverage is 54.54%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #12       +/-   ##
===========================================
- Coverage   72.85%   45.66%   -27.19%     
===========================================
  Files           3       11        +8     
  Lines          70      127       +57     
===========================================
+ Hits           51       58        +7     
- Misses         19       69       +50     
Flag Coverage Δ
cqrs ?
login_client 45.66% <54.54%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/login_client/lib/src/oauth_settings.dart 33.33% <0.00%> (ø)
packages/login_client/lib/src/login_client.dart 76.27% <66.66%> (ø)
packages/cqrs/lib/src/cqrs.dart
packages/cqrs/lib/src/cqrs_exception.dart
packages/cqrs/lib/src/command_result.dart
...ages/login_client/lib/src/oauth2/custom_grant.dart 0.00% <0.00%> (ø)
...ckages/login_client/lib/src/refresh_exception.dart 66.66% <0.00%> (ø)
..._client/lib/src/strategies/sms_token_strategy.dart 0.00% <0.00%> (ø)
...t/lib/src/strategies/raw_credentials_strategy.dart 0.00% <0.00%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a4a3ea...1998b06. Read the comment docs.

@Albert221 Albert221 merged commit a6cbd5d into master Jan 7, 2021
@Albert221 Albert221 deleted the login-client-improvements branch January 7, 2021 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p: login_client_flutter Related to the login_client_flutter package p: login_client Related to the login_client package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Stream for Credentials changes
3 participants