From b1fa2a0a37eb8366aaf755d932fac448cdadeeb3 Mon Sep 17 00:00:00 2001
From: bill bittner <bittner.w@gmail.com>
Date: Fri, 6 Oct 2017 09:21:03 -0700
Subject: [PATCH] fixed auth failure message

---
 public/assets/css/general.css             | 4 ++--
 public/assets/js/generalFunctions.js      | 6 ++++--
 views/partials/publishForm-Url.handlebars | 2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/public/assets/css/general.css b/public/assets/css/general.css
index 56ab7788..54dbff4d 100644
--- a/public/assets/css/general.css
+++ b/public/assets/css/general.css
@@ -60,11 +60,11 @@ p {
 .tooltip:hover > .tooltip-text {
 	visibility: visible;
 }
-
+/* arrow at bottom of tooltip text */
 .tooltip > .tooltip-text::after {
 	content: " ";
 	position: absolute;
-	top: 100%; /* At the bottom of the tooltip */
+	top: 100%;
 	left: 50%;
 	margin-left: -5px;
 	border-width: 5px;
diff --git a/public/assets/js/generalFunctions.js b/public/assets/js/generalFunctions.js
index 5b5f5fe7..f9d1290c 100644
--- a/public/assets/js/generalFunctions.js
+++ b/public/assets/js/generalFunctions.js
@@ -7,8 +7,9 @@ function getRequest (url) {
         xhttp.onreadystatechange = () => {
             if (xhttp.readyState == 4 ) {
                 if ( xhttp.status == 200) {
-                    console.log('response:', xhttp.response);
                     resolve(xhttp.response);
+                } else if (xhttp.status == 401) {
+                    reject('wrong username or password');
                 } else {
                     reject('request failed with status:' + xhttp.status);
                 };
@@ -28,8 +29,9 @@ function postRequest (url, params) {
         xhttp.onreadystatechange = () => {
             if (xhttp.readyState == 4 ) {
                 if ( xhttp.status == 200) {
-                    console.log('response:', xhttp.response);
                     resolve(xhttp.response);
+                } else if (xhttp.status == 401) {
+                    reject('wrong username or password');
                 } else {
                     reject('request failed with status:' + xhttp.status);
                 };
diff --git a/views/partials/publishForm-Url.handlebars b/views/partials/publishForm-Url.handlebars
index 31af09f8..68d94d37 100644
--- a/views/partials/publishForm-Url.handlebars
+++ b/views/partials/publishForm-Url.handlebars
@@ -7,7 +7,7 @@
         <div class="input-text--primary">
             <span class="url-text">Spee.ch /</span>
             <span id="url-channel" class="url-text url-text--primary" {{#if user}}{{else}}hidden="true"{{/if}}>{{user.channelName}}:{{user.shortChannelId}}</span>
-            <span id="url-no-channel-placeholder" class="url-text url-text--secondary tooltip" {{#if user}}hidden="true"{{else}}{{/if}}>xyz<span class="tooltip-text">This will be your random id</span></span>
+            <span id="url-no-channel-placeholder" class="url-text url-text--secondary tooltip" {{#if user}}hidden="true"{{else}}{{/if}}>xyz<span class="tooltip-text">This will be a random id</span></span>
             <span id="url-channel-placeholder" class="url-text url-text--secondary tooltip" hidden="true">@channel<span class="tooltip-text">Select a channel above</span></span>
             /
             <input type="text" id="claim-name-input" class="input-text" placeholder="your-url-here" oninput="checkClaimName(event.target.value)">