From 102ae0c4021db3068607cde1e6c871fdff8efd3a Mon Sep 17 00:00:00 2001 From: Poornima Nayar Date: Tue, 15 Dec 2020 10:13:36 +0000 Subject: [PATCH] Updated the UI docs for the authresouce --- .../src/common/resources/auth.resource.js | 58 ++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/auth.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/auth.resource.js index 936f69e738..e26ac26f7c 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/auth.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/auth.resource.js @@ -12,7 +12,24 @@ function authResource($q, $http, umbRequestHelper, angularHelper) { return { - + /** + * @ngdoc method + * @name umbraco.resources.authResource#get2FAProviders + * @methodOf umbraco.resources.authResource + * + * @description + * Logs the Umbraco backoffice user in if the credentials are good + * + * ##usage + *
+     * authResource.get2FAProviders()
+     *    .then(function(data) {
+     *        //Do stuff ...
+     *    });
+     * 
+ * @returns {Promise} resourcePromise object + * + */ get2FAProviders: function () { return umbRequestHelper.resourcePromise( @@ -23,6 +40,25 @@ function authResource($q, $http, umbRequestHelper, angularHelper) { 'Could not retrive two factor provider info'); }, + /** + * @ngdoc method + * @name umbraco.resources.authResource#get2FAProviders + * @methodOf umbraco.resources.authResource + * + * @description + * Generate the two-factor authentication code for the provider and send it to the user + * + * ##usage + *
+    * authResource.send2FACode(provider)
+    *    .then(function(data) {
+    *        //Do stuff ...
+    *    });
+    * 
+ * @param {string} provider Name of the provider + * @returns {Promise} resourcePromise object + * + */ send2FACode: function (provider) { return umbRequestHelper.resourcePromise( @@ -34,6 +70,26 @@ function authResource($q, $http, umbRequestHelper, angularHelper) { 'Could not send code'); }, + /** + * @ngdoc method + * @name umbraco.resources.authResource#get2FAProviders + * @methodOf umbraco.resources.authResource + * + * @description + * Verify the two-factor authentication code entered by the user against the provider + * + * ##usage + *
+    * authResource.verify2FACode(provider, code)
+    *    .then(function(data) {
+    *        //Do stuff ...
+    *    });
+    * 
+ * @param {string} provider Name of the provider + * @param {string} code The two-factor authentication code + * @returns {Promise} resourcePromise object + * + */ verify2FACode: function (provider, code) { return umbRequestHelper.resourcePromise(