diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..aa033738 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,17 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Launch Program", + "skipFiles": [ + "/**" + ], + "program": "${workspaceFolder}\\index" + } + ] +} \ No newline at end of file diff --git a/app/login.tsx b/app/login.tsx index 9cb37339..ec52bd1e 100644 --- a/app/login.tsx +++ b/app/login.tsx @@ -44,6 +44,27 @@ const Login: React.FC = () => { useEffect(() => { (async () => { + // add a test that checks if the url contains http/https + if (_apiUrl.startsWith("http") || _apiUrl.startsWith("https")) { + { + setServer({ + address: _apiUrl, + }); + } + } else { + //check if url requires ssl + // use curl to see if https is required + // if not use http + // if yes use https + const test = fetch("http://jellyfin.oakgrove.site/web/#/home.html") + .then((response) => console.log(response)) + .catch((error) => console.error(error)); + + const test2 = fetch("https://jellyfin.oakgrove.site/web/#/home.html") + .then((response) => console.log(response)) + .catch((error) => console.error(error)); + } + if (_apiUrl) { setServer({ address: _apiUrl,