mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
remove ensureConnectUser
This commit is contained in:
parent
2542339e42
commit
1e5568943c
1 changed files with 1 additions and 23 deletions
|
@ -234,12 +234,6 @@ define(["events", "apiclient", "appStorage"], function (events, apiClientFactory
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function ensureConnectUser(credentials) {
|
|
||||||
if (connectUser && connectUser.Id === credentials.ConnectUserId) {
|
|
||||||
return Promise.resolve();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function validateAuthentication(server, serverUrl) {
|
function validateAuthentication(server, serverUrl) {
|
||||||
return ajax({
|
return ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
|
@ -415,13 +409,7 @@ define(["events", "apiclient", "appStorage"], function (events, apiClientFactory
|
||||||
var credentials = credentialProvider.credentials();
|
var credentials = credentialProvider.credentials();
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
|
||||||
if (credentials.ConnectAccessToken && false !== options.enableAutoLogin) {
|
afterConnectValidated(server, credentials, systemInfo, connectionMode, serverUrl, true, options, resolve);
|
||||||
ensureConnectUser(credentials).then(function () {
|
|
||||||
afterConnectValidated(server, credentials, systemInfo, connectionMode, serverUrl, true, options, resolve);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
afterConnectValidated(server, credentials, systemInfo, connectionMode, serverUrl, true, options, resolve);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function afterConnectValidated(server, credentials, systemInfo, connectionMode, serverUrl, verifyLocalAuthentication, options, resolve) {
|
function afterConnectValidated(server, credentials, systemInfo, connectionMode, serverUrl, verifyLocalAuthentication, options, resolve) {
|
||||||
|
@ -648,8 +636,6 @@ define(["events", "apiclient", "appStorage"], function (events, apiClientFactory
|
||||||
|
|
||||||
if (!credentials.ConnectUserId || !credentials.ConnectAccessToken || apiClient && apiClient.getCurrentUserId()) {
|
if (!credentials.ConnectUserId || !credentials.ConnectAccessToken || apiClient && apiClient.getCurrentUserId()) {
|
||||||
onEnsureConnectUserDone();
|
onEnsureConnectUserDone();
|
||||||
} else {
|
|
||||||
ensureConnectUser(credentials).then(onEnsureConnectUserDone, onEnsureConnectUserDone);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -823,14 +809,6 @@ define(["events", "apiclient", "appStorage"], function (events, apiClientFactory
|
||||||
if (!pinInfo) {
|
if (!pinInfo) {
|
||||||
throw new Error("pinInfo cannot be null");
|
throw new Error("pinInfo cannot be null");
|
||||||
}
|
}
|
||||||
|
|
||||||
return exchangePin(pinInfo).then(function (result) {
|
|
||||||
var credentials = credentialProvider.credentials();
|
|
||||||
credentials.ConnectAccessToken = result.AccessToken;
|
|
||||||
credentials.ConnectUserId = result.UserId;
|
|
||||||
credentialProvider.credentials(credentials);
|
|
||||||
return ensureConnectUser(credentials);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue