templates/auth_redir.html.erb in lita-gauth-0.1.0.4 vs templates/auth_redir.html.erb in lita-gauth-0.1.0.5

- old
+ new

@@ -10,11 +10,11 @@ <script type="application/javascript"> function showWinner() { const img_url = "https://t1.rbxcdn.com/2997bd147bbf3a8851fbf57339b0e177"; const tmpl = ` - <div> + <div style="display: flex; justify-content: center"> <img src="${img_url}" /> </div>`; render(tmpl); } @@ -23,11 +23,11 @@ const sad_img = "http://www.roadtoepic.com/wp-content/uploads/2013/07/Sad-by-Kate-Alexander1.jpg"; const tmpl = ` <div> <p>Sorry something went wrong!</p> <p>${JSON.stringify(err)}</p> - <img src="${img_url}" /> + <img src="${sad_img}" /> </div> `; render(tmpl); } @@ -37,14 +37,15 @@ window.setTimeout(() => { body.innerHTML = tmpl; }, 3000); } - const key = <%= @storage_key %>; + const key = "<%= @storage_key %>"; const userId = localStorage.getItem(key); - const code = <%= @code %>; - const base_url = <%= @base_url %>; - fetch("${base_url}/auth-save/${userId}/${code}") + const code = "<%= @code %>"; + const base_url = "<%= @base_url %>"; + const url = `${base_url}/${userId}/?code=${encodeURIComponent(code)}`; + fetch(url) .then(resp => { if (resp.ok) { return resp.json() } else { throw Error('Something went wrong with the server!');