react-auth-kit
Advanced tools
Comparing version 3.0.0-alpha.27 to 3.0.0-alpha.28
@@ -30,2 +30,5 @@ "use strict"; | ||
var tokenObject = new _RxTokenObject.default(authName, authType, refreshTokenName, cookieDomain, cookieSecure); | ||
React.useEffect(function () { | ||
tokenObject.syncTokens(tokenObject.value()); | ||
}, [tokenObject.value()]); | ||
return (0, _jsxRuntime.jsx)(_AuthContext.default.Provider, { | ||
@@ -32,0 +35,0 @@ value: tokenObject, |
{ | ||
"name": "react-auth-kit", | ||
"version": "3.0.0-alpha.27", | ||
"version": "3.0.0-alpha.28", | ||
"description": "Authentication Library for React, which makes Token based auth very easy", | ||
@@ -90,3 +90,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "455ed7a8cd1a0e4111791e08336cc7f20583a943" | ||
"gitHead": "014a2f519f74bc5cd2d3c8fa1ad14d079445e760" | ||
} |
@@ -115,3 +115,3 @@ /** | ||
*/ | ||
private syncTokens; | ||
syncTokens: (authState: AuthKitStateInterface<T>) => void; | ||
private setAuthToken; | ||
@@ -118,0 +118,0 @@ private setRefreshToken; |
@@ -22,12 +22,2 @@ "use strict"; | ||
this.authSubject = new _rxjs.BehaviorSubject(this.initialToken_()); | ||
this.authSubject.subscribe({ | ||
next: this.syncTokens, | ||
complete: () => { | ||
console.log("Token Synced"); | ||
}, | ||
error: err => { | ||
console.error("Error Occured while syncing token"); | ||
console.log(err); | ||
} | ||
}); | ||
} | ||
@@ -34,0 +24,0 @@ subscribe = (next, error) => { |
55207
38
1299