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