From 34e6fc08214a67cf8f077d9cb1f7778ab5040848 Mon Sep 17 00:00:00 2001 From: Behrang <18451+behrangsa@users.noreply.github.com> Date: Fri, 6 Jul 2018 23:03:54 +1000 Subject: [PATCH 1/2] options is optional in WebAuth.prototype.authorize In your tutorials, `authorize` is called without any arguments ([example](https://auth0.com/docs/quickstart/spa/jquery/01-login#create-an-authentication-service)). Consequently, `options` should be marked as optional in the JsDoc (i.e. `[options]`), otherwise IDEs might warn that its invocations require 1 argument. --- src/web-auth/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web-auth/index.js b/src/web-auth/index.js index 6368872d..5023e191 100644 --- a/src/web-auth/index.js +++ b/src/web-auth/index.js @@ -541,7 +541,7 @@ WebAuth.prototype.signup = function(options, cb) { * After that, you'll have to use the {@link parseHash} function at the specified `redirectUri`. * * @method authorize - * @param {Object} options + * @param {Object} [options] * @param {String} [options.clientID] the Client ID found on your Application settings page * @param {String} options.redirectUri url that the Auth0 will redirect after Auth with the Authorization Response * @param {String} options.responseType type of the response used by OAuth 2.0 flow. It can be any space separated list of the values `code`, `token`, `id_token`. {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0} From 35059920b44d918248f7c426b0124590639da062 Mon Sep 17 00:00:00 2001 From: Behrang Saeedzadeh Date: Tue, 10 Jul 2018 20:06:58 +1000 Subject: [PATCH 2/2] Marked more optional `options` params as optional in JsDocs. --- src/web-auth/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/web-auth/index.js b/src/web-auth/index.js index 5023e191..423b4c71 100644 --- a/src/web-auth/index.js +++ b/src/web-auth/index.js @@ -360,7 +360,7 @@ WebAuth.prototype.validateToken = function(token, nonce, cb) { * Watch out! If you're not using the hosted login page to do social logins, you have to use your own [social connection keys](https://manage.auth0.com/#/connections/social). If you use Auth0's dev keys, you'll always get `login_required` as an error when calling this method. * * @method renewAuth - * @param {Object} options + * @param {Object} [options] * @param {String} [options.clientID] the Client ID found on your Application settings page * @param {String} [options.redirectUri] url that the Auth0 will redirect after Auth with the Authorization Response * @param {String} [options.responseType] type of the response used by OAuth 2.0 flow. It can be any space separated list of the values `code`, `token`, `id_token`. {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0} @@ -435,7 +435,7 @@ WebAuth.prototype.renewAuth = function(options, cb) { * Renews an existing session on Auth0's servers using `response_mode=web_message` * * @method checkSession - * @param {Object} options + * @param {Object} [options] * @param {String} [options.clientID] the Client ID found on your Application settings page * @param {String} [options.responseType] type of the response used by OAuth 2.0 flow. It can be any space separated list of the values `code`, `token`, `id_token`. {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0} @@ -731,7 +731,7 @@ WebAuth.prototype.crossOriginVerification = function() { * - If the client_id parameter is NOT included, the returnTo URL must be listed in the Allowed Logout URLs set at the account level (see Setting Allowed Logout URLs at the Account Level). * * @method logout - * @param {Object} options + * @param {Object} [options] * @param {String} [options.clientID] the Client ID found on your Application settings page * @param {String} [options.returnTo] URL to be redirected after the logout * @param {Boolean} [options.federated] tells Auth0 if it should logout the user also from the IdP.