-
Notifications
You must be signed in to change notification settings - Fork 16
Automatic resubscription when logged in using jwt property #657
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
Conversation
Codecov Report
@@ Coverage Diff @@
## 7-dev #657 +/- ##
==========================================
+ Coverage 85.65% 85.68% +0.03%
==========================================
Files 36 36
Lines 1708 1712 +4
Branches 309 311 +2
==========================================
+ Hits 1463 1467 +4
Misses 183 183
Partials 62 62
Continue to review full report at Codecov.
|
@@ -429,6 +429,8 @@ export class Kuzzle extends KuzzleEventEmitter { | |||
|
|||
set jwt (encodedJwt) { | |||
this.auth.authenticationToken = encodedJwt; | |||
|
|||
this._loggedIn = encodedJwt ? true : false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be a getter checking the existence of this.auth.authenticationToken
instead of a static member synced by another setter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't because in cookieAuth mode there is no JWT property set but that doesn't mean the SDK is not logged in, that's why I cannot always check if there is a JWT but I can set a property when people do want to put a JWT by hand.
What does this PR do ?
This PR enables the automatic resubscription of the SDK when logged in using the JWT property