Skip to content

Commit a506284

Browse files
committed
Removed console.logs and other unneded code; Formatting
1 parent e3d63cc commit a506284

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

src/index.html

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,32 +62,28 @@
6262
diam.
6363
</p>
6464
</div>
65-
<div id="AuthenticatorFrame"></div>
6665
<script type="module">
6766
import {authorize, revoke, refresh} from "../dist/index.mjs";
68-
let domain = '';
69-
let token = null;
7067
const POPUP_CONFIG = {
7168
width: 800,
7269
height: 600,
7370
top: 50,
7471
left: 50,
7572
title: "Authorize Frontify"
7673
};
77-
7874
const AUTHORIZATION_CONFIG = {
79-
// domain: 'weare.frontify.com',
75+
domain: 'weare.frontify.com',
8076
clientId: 'client-65yw8hnekdg4mssd',
81-
redirectUri: '/connection/frontify-authenticator',
8277
scopes: ["basic:read", "finder:read", "account:read"],
8378
};
79+
80+
let domain = '';
81+
let token = null;
8482

8583
function authorizeAction() {
8684
// handle domain window
8785
if (!token) {
88-
authorize(AUTHORIZATION_CONFIG, POPUP_CONFIG).then(res => {
89-
console.log('initial auth');
90-
console.log(res);
86+
FrontifyAuthenticator.authorize(AUTHORIZATION_CONFIG, POPUP_CONFIG).then(res => {
9187
if (res) {
9288
domain = res.domain;
9389
token = res;
@@ -96,42 +92,35 @@
9692
console.log(err);
9793
});
9894
} else {
99-
console.log('stored auth');
10095
console.log(token);
10196
}
10297
}
10398

10499

105100
function revokeAction() {
106101
if (!token) {
107-
console.log('Nothing to revoke!');
108102
return;
109103
}
110104

111-
revoke(token).then(res => {
112-
console.log('revoked token');
113-
console.log(res);
105+
FrontifyAuthenticator.revoke(token).then(res => {
114106
token = null;
115107
delete(AUTHORIZATION_CONFIG.domain);
116108
});
117109
}
118110

119111
function refreshAction() {
120112
if (!token) {
121-
console.log('Nothing to refresh!');
122113
return;
123114
}
124115

125-
refresh(token).then(res => {
126-
console.log('refreshed token');
127-
console.log(res);
116+
FrontifyAuthenticator.refresh(token).then(res => {
128117
token = res;
129118
});
130119
}
131120

132121
document.getElementById('authorize').addEventListener('click', authorizeAction);
133122
document.getElementById('revoke').addEventListener('click', revokeAction);
134-
document.getElementById('refresh').addEventListener('click', refreshAction)
123+
document.getElementById('refresh').addEventListener('click', refreshAction);
135124
</script>
136125

137126
</body>

0 commit comments

Comments
 (0)