@accounts/client
Advanced tools
Comparing version 0.19.0 to 0.20.0-alpha.1.cfb0004e
@@ -22,2 +22,8 @@ import { LoginResult, Tokens, ImpersonationResult, User } from '@accounts/types'; | ||
/** | ||
* Authenticate the user with a specific service (not creating a session) | ||
*/ | ||
authenticateWithService(service: string, credentials: { | ||
[key: string]: any; | ||
}): Promise<boolean>; | ||
/** | ||
* Login the user with a specific service | ||
@@ -32,3 +38,3 @@ */ | ||
*/ | ||
refreshSession(): Promise<Tokens | null>; | ||
refreshSession(force?: boolean): Promise<Tokens | null>; | ||
/** | ||
@@ -35,0 +41,0 @@ * Impersonate to another user. |
@@ -98,2 +98,12 @@ "use strict"; | ||
/** | ||
* Authenticate the user with a specific service (not creating a session) | ||
*/ | ||
AccountsClient.prototype.authenticateWithService = function (service, credentials) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
return [2 /*return*/, this.transport.authenticateWithService(service, credentials)]; | ||
}); | ||
}); | ||
}; | ||
/** | ||
* Login the user with a specific service | ||
@@ -121,3 +131,4 @@ */ | ||
*/ | ||
AccountsClient.prototype.refreshSession = function () { | ||
AccountsClient.prototype.refreshSession = function (force) { | ||
if (force === void 0) { force = false; } | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
@@ -136,3 +147,3 @@ var tokens, isAccessTokenExpired, isRefreshTokenExpired, refreshedSession, err_1; | ||
isRefreshTokenExpired = utils_1.isTokenExpired(tokens.refreshToken); | ||
if (!(isAccessTokenExpired && !isRefreshTokenExpired)) return [3 /*break*/, 5]; | ||
if (!((force || isAccessTokenExpired) && !isRefreshTokenExpired)) return [3 /*break*/, 5]; | ||
return [4 /*yield*/, this.transport.refreshTokens(tokens.accessToken, tokens.refreshToken)]; | ||
@@ -139,0 +150,0 @@ case 3: |
@@ -6,2 +6,5 @@ import { LoginResult, ImpersonationResult, CreateUser, User } from '@accounts/types'; | ||
createUser(user: CreateUser): Promise<string>; | ||
authenticateWithService(service: string, authenticateParams: { | ||
[key: string]: string | object; | ||
}): Promise<boolean>; | ||
loginWithService(service: string, authenticateParams: { | ||
@@ -8,0 +11,0 @@ [key: string]: string | object; |
{ | ||
"name": "@accounts/client", | ||
"version": "0.19.0", | ||
"version": "0.20.0-alpha.1.cfb0004e", | ||
"description": "Fullstack authentication and accounts-management", | ||
@@ -48,3 +48,3 @@ "main": "lib/index.js", | ||
"@types/jwt-decode": "2.2.1", | ||
"@types/node": "12.7.2", | ||
"@types/node": "12.7.4", | ||
"jest": "24.9.0", | ||
@@ -57,7 +57,6 @@ "jest-localstorage-mock": "2.4.0", | ||
"dependencies": { | ||
"@accounts/types": "^0.19.0", | ||
"@accounts/types": "^0.20.0-alpha.1.cfb0004e", | ||
"jwt-decode": "2.2.0", | ||
"tslib": "1.10.0" | ||
}, | ||
"gitHead": "c0a7905161c702350efd4f7a622c55ede495a42b" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
426
25529
26
+ Added@accounts/types@0.20.1(transitive)
- Removed@accounts/types@0.19.0(transitive)