Settings now use the seasonedAPI controller for plex authentication. Now only handles the response from plex, given username and password

This commit is contained in:
2019-06-04 22:16:08 +02:00
parent c3d7642e26
commit 8c5a8212c0

View File

@@ -60,33 +60,34 @@ export default {
}
},
methods: {
setValue(l, t) {
console.log('l, t', l, t)
this[l] = t
},
changePassword() {
return
},
authenticatePlex() {
let username = this.plexUsername
let password = this.plexPassword
setValue(l, t) {
console.log('l, t', l, t)
this[l] = t
},
changePassword() {
return
},
authenticatePlex() {
let username = this.plexUsername
let password = this.plexPassword
plexAuthenticate(username, password)
.then((resp) => {
let data = resp.data;
console.log('response from plex:', data.user)
})
.catch((error) => {
console.log('error: ', error)
})
},
created(){
document.title = 'Settings' + storage.pageTitlePostfix;
storage.backTitle = document.title;
if(!localStorage.getItem('token')){
this.userLoggedIn = false;
} else {
this.userLoggedIn = true;
plexAuthenticate(username, password)
.then((resp) => {
let data = resp.data;
console.log('response from plex:', data.user)
})
.catch((error) => {
console.log('error: ', error)
})
},
created(){
document.title = 'Settings' + storage.pageTitlePostfix;
storage.backTitle = document.title;
if(!localStorage.getItem('token')){
this.userLoggedIn = false;
} else {
this.userLoggedIn = true;
}
}
}
}