From ea3e503d13b7be477c064b02b9b2e5a9ef06c9a9 Mon Sep 17 00:00:00 2001 From: Pitu Date: Fri, 29 Mar 2019 00:35:58 +0900 Subject: Added middleware for pages and switched to $axios --- src/site/pages/faq.vue | 95 ++------------------------------------------------ 1 file changed, 3 insertions(+), 92 deletions(-) (limited to 'src/site/pages/faq.vue') diff --git a/src/site/pages/faq.vue b/src/site/pages/faq.vue index 32a1ee2..904ec5f 100644 --- a/src/site/pages/faq.vue +++ b/src/site/pages/faq.vue @@ -43,34 +43,8 @@ There are too many file upload services out there, and a lot of them rely on the foundations of pomf which is ancient. In a desperate and unsuccessful attempt of finding a good file uploader that's easily extendable, lolisafe was born. We give you control over your files, we give you a way to sort your uploads into albums for ease of access and we give you an api to use with ShareX or any other thing that let's you make POST requests. - - - @@ -78,76 +52,13 @@ import Navbar from '~/components/navbar/Navbar.vue'; export default { - name: 'Login', + name: 'Faq', components: { Navbar }, data() { - return { - username: null, - password: null, - mfaCode: null, - isMfaModalActive: false, - isLoading: false - }; - }, - computed: { - config() { - return this.$store.state.config; - } + return {}; }, metaInfo() { - return { title: 'Login' }; - }, - methods: { - login() { - if (this.isLoading) return; - if (!this.username || !this.password) { - this.$showToast('Please fill both fields before attempting to log in.', true); - return; - } - this.isLoading = true; - this.axios.post(`${this.config.baseURL}/auth/login`, { - username: this.username, - password: this.password - }).then(res => { - this.$store.commit('token', res.data.token); - this.$store.commit('user', res.data.user); - /* - if (res.data.mfa) { - this.isMfaModalActive = true; - this.isLoading = false; - } else { - this.getUserData(); - } - */ - this.redirect(); - }).catch(err => { - this.isLoading = false; - this.$onPromiseError(err); - }); - }, - /* - mfa() { - if (!this.mfaCode) return; - if (this.isLoading) return; - this.isLoading = true; - this.axios.post(`${this.$BASE_URL}/login/mfa`, { token: this.mfaCode }) - .then(res => { - this.$store.commit('token', res.data.token); - this.redirect(); - }) - .catch(err => { - this.isLoading = false; - this.$onPromiseError(err); - }); - },*/ - redirect() { - this.$store.commit('loggedIn', true); - if (typeof this.$route.query.redirect !== 'undefined') { - this.$router.push(this.$route.query.redirect); - return; - } - this.$router.push('/dashboard'); - } + return { title: 'Faq' }; } }; -- cgit v1.2.3