From 1e0d129b8a6748f635b6f6985d7dae2ece747e55 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 27 Feb 2017 18:21:35 -0700 Subject: [PATCH] bugfix api --- oauth3.core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oauth3.core.js b/oauth3.core.js index 73015a2..e5a7dbb 100644 --- a/oauth3.core.js +++ b/oauth3.core.js @@ -969,7 +969,7 @@ } , api: function (providerUri, opts) { if (!OAUTH3.api[opts.api]) { - throw new Error("No API for '" + providerUri + "'"); + return OAUTH3.PromiseA.reject(new Error("No API for '" + providerUri + "'")); } return OAUTH3.api[opts.api](providerUri, opts); @@ -1073,7 +1073,7 @@ opts = opts || {}; opts.api = api; opts.session = OAUTH3.hooks.session._getCached(this._providerUri); - OAUTH3.api(this._providerUri, opts); + return OAUTH3.api(this._providerUri, opts); } }; result.authenticate = result.login;