Authenticating with plex now happens to seasonedShows backend and not through plex.tv.
This commit is contained in:
23
src/api.js
23
src/api.js
@@ -214,28 +214,19 @@ const getRequestStatus = (id, type, authorization_token=undefined) => {
|
|||||||
// - - - Authenticate with plex - - -
|
// - - - Authenticate with plex - - -
|
||||||
|
|
||||||
const plexAuthenticate = (username, password) => {
|
const plexAuthenticate = (username, password) => {
|
||||||
const url = new URL('https://plex.tv/api/v2/users/signin')
|
const url = new URL('v1/user/authenticate', SEASONED_URL)
|
||||||
|
const body = { username, password }
|
||||||
const headers = {
|
const headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'X-Plex-Platform': 'Linux',
|
authorization: storage.token
|
||||||
'X-Plex-Version': 'v2.0.24',
|
|
||||||
'X-Plex-Platform-Version': '4.13.0-36-generic',
|
|
||||||
'X-Plex-Device-Name': 'Tautulli',
|
|
||||||
'X-Plex-Client-Identifier': '123'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let formData = new FormData()
|
return fetch(url.href, {
|
||||||
formData.set('login', username)
|
|
||||||
formData.set('password', password)
|
|
||||||
formData.set('rememberMe', false)
|
|
||||||
|
|
||||||
return axios({
|
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: url.href,
|
headers,
|
||||||
headers: headers,
|
body: JSON.stringify(body)
|
||||||
data: formData
|
|
||||||
})
|
})
|
||||||
|
.then(resp => resp.json())
|
||||||
.catch(error => { console.error(`api error authentication plex: ${username}`); throw error })
|
.catch(error => { console.error(`api error authentication plex: ${username}`); throw error })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user