2019-02-26 01:17:52 +01:00
|
|
|
<template lang="pug">
|
2019-03-04 02:15:22 +01:00
|
|
|
b-modal(hide-header hide-footer @hide='$router.go(-1)' :visible='true')
|
2019-02-26 01:17:52 +01:00
|
|
|
h4.text-center {{$t('Settings')}}
|
|
|
|
|
b-form
|
|
|
|
|
b-input-group.mt-1(prepend='Email')
|
|
|
|
|
b-form-input(v-model="user.email")
|
|
|
|
|
//- b-form-checkbox(v-model="tmpUser.user.autoboost") Autoboost
|
|
|
|
|
b-input-group.mt-1(prepend='Mastodon instance')
|
|
|
|
|
b-form-input(v-model="mastodon_instance")
|
|
|
|
|
b-input-group-append
|
|
|
|
|
b-button(@click='associate', variant='primary') Associate
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import { mapState, mapActions } from 'vuex'
|
|
|
|
|
import api from '@/api'
|
|
|
|
|
export default {
|
|
|
|
|
props: ['code'],
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
mastodon_instance: '',
|
|
|
|
|
user: {}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: mapState(['oauth']),
|
|
|
|
|
async mounted () {
|
|
|
|
|
const code = this.$route.query.code
|
|
|
|
|
if (code) {
|
|
|
|
|
const res = await api.setCode({code})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const user = await api.getUser()
|
|
|
|
|
this.user = user
|
2019-02-26 14:32:49 +01:00
|
|
|
this.mastodon_instance = user.mastodon_instance
|
2019-02-26 01:17:52 +01:00
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async associate () {
|
|
|
|
|
const url = await api.getAuthURL({instance: this.mastodon_instance})
|
|
|
|
|
setTimeout( () => window.location.href=url, 100);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|