Merge pull request #958 from movie-web/965-backend-https-default

Automatically prefix backend url with https:// if not provided
This commit is contained in:
William Oldham 2024-02-29 22:01:49 +00:00 committed by GitHub
commit 10fa48ba04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -208,7 +208,13 @@ export function SettingsPage() {
// when backend url gets changed, log the user out first
if (state.backendUrl.changed) {
await logout();
setBackendUrl(state.backendUrl.state);
let url = state.backendUrl.state;
if (url && !url.startsWith("http://") && !url.startsWith("https://")) {
url = `https://${url}`;
}
setBackendUrl(url);
}
}, [
state,