mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-14 04:20:07 +02:00
Remote URL hardcoding compatibility (#1810)
* Remote URL compatibility --------- Co-authored-by: jeffvli <jeffvictorli@gmail.com>
This commit is contained in:
@@ -65,6 +65,7 @@ const LoginRoute = () => {
|
||||
const serverType = window.SERVER_TYPE ? toServerType(window.SERVER_TYPE) : null;
|
||||
const serverName = window.SERVER_NAME || '';
|
||||
const serverUrl = window.SERVER_URL || '';
|
||||
const remoteUrl = window.REMOTE_URL || '';
|
||||
const legacyAuth = serverLock && isLegacyAuth();
|
||||
|
||||
const config = [
|
||||
@@ -88,6 +89,11 @@ const LoginRoute = () => {
|
||||
key: 'SERVER_URL',
|
||||
value: serverUrl,
|
||||
},
|
||||
{
|
||||
isValid: remoteUrl !== '',
|
||||
key: 'REMOTE_URL',
|
||||
value: remoteUrl,
|
||||
},
|
||||
];
|
||||
|
||||
const form = useForm({
|
||||
@@ -150,6 +156,7 @@ const LoginRoute = () => {
|
||||
}
|
||||
|
||||
const normalizedUrl = normalizeUrl(serverUrl);
|
||||
const normalizedRemoteURL = normalizeUrl(remoteUrl);
|
||||
const existingServer =
|
||||
serverLock &&
|
||||
Object.values(serverList).find((s) => normalizeUrl(s.url) === normalizedUrl);
|
||||
@@ -159,6 +166,7 @@ const LoginRoute = () => {
|
||||
id: nanoid(),
|
||||
isAdmin: data.isAdmin,
|
||||
name: serverName,
|
||||
remoteUrl: normalizedRemoteURL,
|
||||
type: serverType as ServerType,
|
||||
url: normalizedUrl,
|
||||
userId: data.userId,
|
||||
|
||||
Vendored
+1
@@ -74,6 +74,7 @@ declare global {
|
||||
FS_PLAYBACK_TRANSCODE_ENABLED?: string;
|
||||
FS_PLAYBACK_WEB_AUDIO?: string;
|
||||
LEGACY_AUTHENTICATION?: boolean | string;
|
||||
REMOTE_URL?: string;
|
||||
SERVER_LOCK?: boolean | string;
|
||||
SERVER_NAME?: string;
|
||||
SERVER_TYPE?: string;
|
||||
|
||||
Reference in New Issue
Block a user