mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-28 19:10:40 +00:00
- set password backend
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div id="single-page">
|
||||
<div v-show="! isLoading" id="page-content" class="large-width center-page">
|
||||
<div v-show="! isLoadingPage" id="page-content" class="large-width center-page">
|
||||
|
||||
<div class="content-page auth-form">
|
||||
<div class="plan-title">
|
||||
@@ -40,7 +40,7 @@
|
||||
</ValidationObserver>
|
||||
</div>
|
||||
</div>
|
||||
<div id="loader" v-if="isLoading">
|
||||
<div id="loader" v-if="isLoadingPage">
|
||||
<Spinner></Spinner>
|
||||
</div>
|
||||
</div>
|
||||
@@ -95,10 +95,11 @@
|
||||
return {
|
||||
requested: undefined,
|
||||
isSubmitted: false,
|
||||
isLoading: true,
|
||||
isLoading: false,
|
||||
isLoadingPage: true,
|
||||
isError: false,
|
||||
password: undefined,
|
||||
password_confirmation: undefined,
|
||||
password: 'vuefilemanager',
|
||||
password_confirmation: 'vuefilemanager',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -114,9 +115,15 @@
|
||||
|
||||
// Send request to get user token
|
||||
axios
|
||||
.post('/api/oasis/register', this.register)
|
||||
.post(`/oasis/subscribe/${this.$route.params.id}/set-password`, {
|
||||
password: this.password,
|
||||
password_confirmation: this.password_confirmation,
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
// Set login state
|
||||
this.$store.commit('SET_AUTHORIZED', true)
|
||||
|
||||
// Go to files page
|
||||
this.$router.push({name: 'Files'})
|
||||
})
|
||||
@@ -138,15 +145,19 @@
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
axios.get(`/api/oasis/subscription-request/${this.$route.params.id}`)
|
||||
axios.get(`/api/oasis/subscribe/${this.$route.params.id}`)
|
||||
.then(response => {
|
||||
this.requested = response.data
|
||||
|
||||
if (response.data.data.attributes.status === 'logged') {
|
||||
this.$router.push({name: 'SignIn'})
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.$isSomethingWrong()
|
||||
})
|
||||
.finally(() => {
|
||||
this.isLoading = false
|
||||
this.isLoadingPage = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@
|
||||
this.$isSomethingWrong()
|
||||
})
|
||||
|
||||
axios.get(`/api/oasis/subscription-request/${this.$route.params.id}`)
|
||||
axios.get(`/api/oasis/subscribe/${this.$route.params.id}`)
|
||||
.then(response => {
|
||||
this.requestedPlan = response.data
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -15,7 +15,7 @@ const routesOasis = [
|
||||
component: () =>
|
||||
import(/* webpackChunkName: "chunks/oasis/platba" */ './Oasis/Pages/SubscriptionRequestPayment'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
requiresAuth: false,
|
||||
title: 'Platba'
|
||||
},
|
||||
},
|
||||
@@ -25,7 +25,7 @@ const routesOasis = [
|
||||
component: () =>
|
||||
import(/* webpackChunkName: "chunks/oasis/platba" */ './Oasis/Pages/CreatePasswordAfterPayment'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
requiresAuth: false,
|
||||
title: 'Vytvorit Heslo'
|
||||
},
|
||||
},
|
||||
|
||||
@@ -146,17 +146,6 @@
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
if (error.response.status == 401) {
|
||||
|
||||
if (error.response.data.error === 'invalid_client') {
|
||||
events.$emit('alert:open', {
|
||||
emoji: '🤔',
|
||||
title: this.$t('popup_passport_error.title'),
|
||||
message: this.$t('popup_passport_error.message')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (error.response.status == 500) {
|
||||
|
||||
events.$emit('alert:open', {
|
||||
|
||||
Reference in New Issue
Block a user