File tree 3 files changed +9
-4
lines changed 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
# Change Log
2
2
3
+ ## v0.7.1-alpha
4
+ - Storing ` AccessToken.createdOn ` in seconds to be consistent with other RAI SDKs.
5
+
6
+ ## v0.7.0
7
+
3
8
## [ v0.7.0] ( https://github.com/relationalai/rai-sdk-javascript/tree/v0.7.0 ) (2022-XX-XX)
4
9
5
10
[ Full Changelog] ( https://github.com/relationalai/rai-sdk-javascript/compare/v0.6.3...v0.7.0 )
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @relationalai/rai-sdk-javascript" ,
3
3
"description" : " RelationalAI SDK for JavaScript" ,
4
- "version" : " 0.7.0 " ,
4
+ "version" : " 0.7.1-alpha " ,
5
5
"author" : {
6
6
"name" : " RelationalAI" ,
7
7
"url" : " https://relational.ai"
Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ class AccessToken {
41
41
) { }
42
42
43
43
get isExpired ( ) {
44
- // experiesIn stored in seconds
45
- const delta = ( Date . now ( ) - this . createdOn ) / 1000 ;
44
+ // createdOn and experiesIn stored in seconds
45
+ const delta = Date . now ( ) / 1000 - this . createdOn ;
46
46
47
47
// anticipate access token expiration by 60 seconds
48
48
return delta + 60 >= this . experiesIn ;
@@ -126,7 +126,7 @@ export class ClientCredentials extends Credentials {
126
126
const token : AccessTokenCache = {
127
127
access_token : data . access_token ,
128
128
expires_in : data . expires_in ,
129
- created_on : Date . now ( ) ,
129
+ created_on : Date . now ( ) / 1000 ,
130
130
} ;
131
131
132
132
this . accessToken = new AccessToken (
You can’t perform that action at this time.
0 commit comments