Skip to content
This repository was archived by the owner on Feb 10, 2022. It is now read-only.

Commit 0dd38e4

Browse files
authored
Release quickstart sample 1.3.1 (#11)
* Add auto-authentication feature
1 parent 4cbaf0d commit 0dd38e4

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

js/main.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ import CallLogView from "../lib/views/CallLogView";
77
import { ACCESS_TOKEN, IS_ACCESS_TOKEN_NEEDED, TEST_APP_ID, USER_ID } from "../envs";
88

99
function onLoadedHandler() {
10+
const urlParams = new URLSearchParams(window.location.search);
11+
const query = urlParams.get('q');
12+
let args = {};
13+
if (query) {
14+
try {
15+
args = JSON.parse(atob(query));
16+
} catch(e) {}
17+
}
18+
1019
const app = new MainApp({
1120
id: 'main_app',
1221
pages: {
@@ -18,9 +27,9 @@ function onLoadedHandler() {
1827
},
1928
styles: {},
2029
args: {
21-
appId: TEST_APP_ID,
22-
userId: USER_ID,
23-
accessToken: ACCESS_TOKEN,
30+
appId: args.app_id || TEST_APP_ID,
31+
userId: args.user_id || USER_ID,
32+
accessToken: args.access_token || ACCESS_TOKEN,
2433
isAccessTokenNeeded: IS_ACCESS_TOKEN_NEEDED,
2534
}
2635
});

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "calls-quickstart",
3-
"version": "1.2.1",
3+
"version": "1.3.1",
44
"description": "",
55
"main": "app.js",
66
"scripts": {

0 commit comments

Comments
 (0)