pinokiod 3.264.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.264.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')
@@ -675,8 +675,7 @@
675
675
  setStatus('Waiting for connection...', 'warning')
676
676
  const secureWindow = window.open(SECURE_CONNECT_URL, '_blank')
677
677
  if (!secureWindow) {
678
- window.location.href = SECURE_CONNECT_URL
679
- return
678
+ setStatus('Could not open the secure window. Please allow pop-ups or open https://pinokio.localhost/connect/<%=name%> manually.', 'error')
680
679
  }
681
680
  pollConnectStatus()
682
681
  connectPollTimer = setInterval(pollConnectStatus, CONNECT_POLL_INTERVAL)