aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-07-09 17:27:03 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2019-07-23 14:18:41 +0200
commit056c53da68eaa007a7bcabf77ef3205b6ff04ca1 (patch)
tree8fe6a777a6694e2bb19110b12c90a9257b695bd9
parentd325856a3cb88b18a1726e30309543f0154df9de (diff)
AFB.js: Improve default token discovery
The example script AFB.js should look int the URLs of the page if the token is set or not and then use it. Bug-AGL: SPEC-2661 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh> Change-Id: I4adba8eac214130b425b6cd3c56fc1dc63543011
-rw-r--r--test/AFB.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/AFB.js b/test/AFB.js
index 65648437..4c500b99 100644
--- a/test/AFB.js
+++ b/test/AFB.js
@@ -21,7 +21,7 @@ if (typeof base != "object")
var initial = {
base: base.base || "api",
- token: base.token || initialtoken || "HELLO",
+ token: initialtoken || base.token || URLSearchParams(window.location.search).get('token') || "HELLO",
host: base.host || window.location.host,
url: base.url || undefined
};