@forgerock/javascript-sdk-ui
Advanced tools
Comparing version
@@ -8,2 +8,8 @@ # Changelog | ||
## [1.0.2] - 2020-01-06 | ||
### Added | ||
- Updates to WebAuthn handler | ||
## [1.0.1] - 2019-12-19 | ||
@@ -10,0 +16,0 @@ |
/** @hidden */ | ||
declare enum WebAuthnMode { | ||
Authenticate = "authenticate", | ||
Register = "register" | ||
Authentication = "authentication", | ||
Registration = "registration" | ||
} | ||
export { WebAuthnMode }; |
/** @hidden */ | ||
var WebAuthnMode; | ||
(function (WebAuthnMode) { | ||
WebAuthnMode["Authenticate"] = "authenticate"; | ||
WebAuthnMode["Register"] = "register"; | ||
WebAuthnMode["Authentication"] = "authentication"; | ||
WebAuthnMode["Registration"] = "registration"; | ||
})(WebAuthnMode || (WebAuthnMode = {})); | ||
export { WebAuthnMode }; | ||
//# sourceMappingURL=enums.js.map |
@@ -48,3 +48,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
this.completeStep = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var _a, authenticated, registered; | ||
var _a; | ||
return __generator(this, function (_b) { | ||
@@ -55,19 +55,19 @@ switch (_b.label) { | ||
switch (_a) { | ||
case WebAuthnMode.Authenticate: return [3 /*break*/, 1]; | ||
case WebAuthnMode.Register: return [3 /*break*/, 3]; | ||
case WebAuthnMode.Authentication: return [3 /*break*/, 1]; | ||
case WebAuthnMode.Registration: return [3 /*break*/, 3]; | ||
} | ||
return [3 /*break*/, 5]; | ||
case 1: | ||
this.message.innerHTML = 'Please authenticate with your device ...'; | ||
this.message.innerHTML = 'Please authenticate using your device...'; | ||
return [4 /*yield*/, FRWebAuthn.authenticate(this.step)]; | ||
case 2: | ||
authenticated = _b.sent(); | ||
this.deferred.resolve(authenticated); | ||
_b.sent(); | ||
this.deferred.resolve(this.step); | ||
return [3 /*break*/, 6]; | ||
case 3: | ||
this.message.innerHTML = 'Please register your device ...'; | ||
this.message.innerHTML = 'Please register your device...'; | ||
return [4 /*yield*/, FRWebAuthn.register(this.step)]; | ||
case 4: | ||
registered = _b.sent(); | ||
this.deferred.resolve(registered); | ||
_b.sent(); | ||
this.deferred.resolve(this.step); | ||
return [3 /*break*/, 6]; | ||
@@ -74,0 +74,0 @@ case 5: throw new Error("Invalid WebAuthn mode \"" + this.mode + "\""); |
@@ -16,6 +16,6 @@ import { FRWebAuthn, WebAuthnStepType } from '@forgerock/javascript-sdk'; | ||
} | ||
var webAuthnStepType = FRWebAuthn.getWebAuthStepType(step); | ||
var webAuthnStepType = FRWebAuthn.getWebAuthnStepType(step); | ||
if (webAuthnStepType !== WebAuthnStepType.None) { | ||
var isAuth = webAuthnStepType === WebAuthnStepType.Authentication; | ||
var webAuthnMode = isAuth ? WebAuthnMode.Authenticate : WebAuthnMode.Register; | ||
var webAuthnMode = isAuth ? WebAuthnMode.Authentication : WebAuthnMode.Registration; | ||
return new WebAuthnStepHandler(target, step, webAuthnMode); | ||
@@ -22,0 +22,0 @@ } |
/** @hidden */ | ||
declare enum WebAuthnMode { | ||
Authenticate = "authenticate", | ||
Register = "register" | ||
Authentication = "authentication", | ||
Registration = "registration" | ||
} | ||
export { WebAuthnMode }; |
@@ -6,6 +6,6 @@ "use strict"; | ||
(function (WebAuthnMode) { | ||
WebAuthnMode["Authenticate"] = "authenticate"; | ||
WebAuthnMode["Register"] = "register"; | ||
WebAuthnMode["Authentication"] = "authentication"; | ||
WebAuthnMode["Registration"] = "registration"; | ||
})(WebAuthnMode || (WebAuthnMode = {})); | ||
exports.WebAuthnMode = WebAuthnMode; | ||
//# sourceMappingURL=enums.js.map |
@@ -53,3 +53,3 @@ "use strict"; | ||
this.completeStep = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var _a, authenticated, registered; | ||
var _a; | ||
return __generator(this, function (_b) { | ||
@@ -60,19 +60,19 @@ switch (_b.label) { | ||
switch (_a) { | ||
case enums_1.WebAuthnMode.Authenticate: return [3 /*break*/, 1]; | ||
case enums_1.WebAuthnMode.Register: return [3 /*break*/, 3]; | ||
case enums_1.WebAuthnMode.Authentication: return [3 /*break*/, 1]; | ||
case enums_1.WebAuthnMode.Registration: return [3 /*break*/, 3]; | ||
} | ||
return [3 /*break*/, 5]; | ||
case 1: | ||
this.message.innerHTML = 'Please authenticate with your device ...'; | ||
this.message.innerHTML = 'Please authenticate using your device...'; | ||
return [4 /*yield*/, javascript_sdk_1.FRWebAuthn.authenticate(this.step)]; | ||
case 2: | ||
authenticated = _b.sent(); | ||
this.deferred.resolve(authenticated); | ||
_b.sent(); | ||
this.deferred.resolve(this.step); | ||
return [3 /*break*/, 6]; | ||
case 3: | ||
this.message.innerHTML = 'Please register your device ...'; | ||
this.message.innerHTML = 'Please register your device...'; | ||
return [4 /*yield*/, javascript_sdk_1.FRWebAuthn.register(this.step)]; | ||
case 4: | ||
registered = _b.sent(); | ||
this.deferred.resolve(registered); | ||
_b.sent(); | ||
this.deferred.resolve(this.step); | ||
return [3 /*break*/, 6]; | ||
@@ -79,0 +79,0 @@ case 5: throw new Error("Invalid WebAuthn mode \"" + this.mode + "\""); |
@@ -22,6 +22,6 @@ "use strict"; | ||
} | ||
var webAuthnStepType = javascript_sdk_1.FRWebAuthn.getWebAuthStepType(step); | ||
var webAuthnStepType = javascript_sdk_1.FRWebAuthn.getWebAuthnStepType(step); | ||
if (webAuthnStepType !== javascript_sdk_1.WebAuthnStepType.None) { | ||
var isAuth = webAuthnStepType === javascript_sdk_1.WebAuthnStepType.Authentication; | ||
var webAuthnMode = isAuth ? enums_1.WebAuthnMode.Authenticate : enums_1.WebAuthnMode.Register; | ||
var webAuthnMode = isAuth ? enums_1.WebAuthnMode.Authentication : enums_1.WebAuthnMode.Registration; | ||
return new webauthn_1.default(target, step, webAuthnMode); | ||
@@ -28,0 +28,0 @@ } |
{ | ||
"name": "@forgerock/javascript-sdk-ui", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "ForgeRock JavaScript SDK with UI rendering capability", | ||
@@ -54,3 +54,3 @@ "main": "./lib/", | ||
"dependencies": { | ||
"@forgerock/javascript-sdk": "^1.0.1" | ||
"@forgerock/javascript-sdk": "^1.0.4" | ||
}, | ||
@@ -57,0 +57,0 @@ "devDependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1159316
-6.03%7768
-0.56%