diff --git a/packages/lib-panoptes-js/dev/index.html b/packages/lib-panoptes-js/dev/index.html index c68d4e3f29..9fd7ae331a 100644 --- a/packages/lib-panoptes-js/dev/index.html +++ b/packages/lib-panoptes-js/dev/index.html @@ -24,6 +24,7 @@

Panoptes.js dev app

Functions

+
Current user: ${user.login}\n` + this.html.message.innerHTML += `> Current user: ${user.login} \n` } else { this.html.message.innerHTML += `> Current user: [nobody] \n` } } catch (err) { console.error(err) - this.html.message.innerHTML += `> [ERROR] ${err.toString()}\n` + this.html.message.innerHTML += `> [ERROR] ${err.toString()} \n` + } + return false + } + + async signOutButton_onClick (e) { + try { + const success = await signOut() + if (success) { + this.html.message.innerHTML += `> Successfully signed out \n` + } else { + this.html.message.innerHTML += `> There's no user to sign out \n` + } + } catch (err) { + console.error(err) + this.html.message.innerHTML += `> [ERROR] ${err.toString()} \n` } return false } @@ -41,13 +59,13 @@ class App { // Note: await is necessary to catch sign in errors. const user = await signIn(formData.get('login'), formData.get('password')) if (user) { - this.html.message.innerHTML += `> Logged in as ${user.login}\n` + this.html.message.innerHTML += `> Logged in as ${user.login} \n` } else { throw new Error('No user?') } } catch (err) { console.error(err) - this.html.message.innerHTML += `> [ERROR] ${err.toString()}\n` + this.html.message.innerHTML += `> [ERROR] ${err.toString()} \n` } return false }