pinokiod 3.263.0 → 3.265.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.263.0",
3
+ "version": "3.265.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -4882,8 +4882,10 @@ class Server {
4882
4882
  }
4883
4883
  //res.render(`connect/${req.params.provider}`, {
4884
4884
  const config = this.kernel.connect.config[req.params.provider]
4885
+ const isPinokioHost = req.hostname === 'pinokio.localhost'
4886
+ const renderProtocol = isPinokioHost ? 'https' : 'http'
4885
4887
  res.render(`connect/index`, {
4886
- protocol: req.$source.protocol,
4888
+ protocol: renderProtocol,
4887
4889
  name: req.params.provider,
4888
4890
  config,
4889
4891
  portal: this.portal,
@@ -258,7 +258,7 @@
258
258
 
259
259
  <script>
260
260
  const CONNECT_NAME = "<%=name%>"
261
- const isSecureConnectContext = window.location.protocol === 'https:' && window.location.hostname === 'pinokio.localhost'
261
+ const isSecureConnectContext = <%= protocol === "https" ? 'true' : 'false' %>
262
262
  const statusElement = document.getElementById('status')
263
263
  const loaderElement = document.getElementById('connect-loader')
264
264
  const loaderMessageElement = document.getElementById('loader-message')
@@ -417,15 +417,10 @@
417
417
  setStatus('Failed to logout: ' + err.message, 'error')
418
418
  } finally {
419
419
  hideLoader()
420
- if (loginSection) {
421
- loginSection.classList.remove('hidden')
422
- }
423
- if (httpSection) {
424
- httpSection.classList.remove('hidden')
425
- }
426
420
  if (userSection) {
427
421
  userSection.classList.add('hidden')
428
422
  }
423
+ configureInitialView()
429
424
  }
430
425
  }
431
426
 
@@ -680,8 +675,7 @@
680
675
  setStatus('Waiting for connection...', 'warning')
681
676
  const secureWindow = window.open(SECURE_CONNECT_URL, '_blank')
682
677
  if (!secureWindow) {
683
- window.location.href = SECURE_CONNECT_URL
684
- return
678
+ setStatus('Could not open the secure window. Please allow pop-ups or open https://pinokio.localhost/connect/<%=name%> manually.', 'error')
685
679
  }
686
680
  pollConnectStatus()
687
681
  connectPollTimer = setInterval(pollConnectStatus, CONNECT_POLL_INTERVAL)