routing improved, settings initialized
This commit is contained in:
@@ -39,7 +39,7 @@ export default {
|
||||
const response = await apiClient.post('/api/auth/activate', { token: this.token });
|
||||
if (response.status === 200) {
|
||||
this.user.active = true;
|
||||
this.$router.push('/'); // Redirect to login after activation
|
||||
this.$router.push('/settings/personal');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error activating account:', error);
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
<RandomChatDialog ref="randomChatDialog" />
|
||||
<RegisterDialog ref="registerDialog" />
|
||||
<PasswordResetDialog ref="passwordResetDialog" />
|
||||
<ErrorDialog ref="errorDialog" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -47,6 +48,7 @@ import RegisterDialog from '@/dialogues/auth/RegisterDialog.vue';
|
||||
import PasswordResetDialog from '@/dialogues/auth/PasswordResetDialog.vue';
|
||||
import apiClient from '@/utils/axios.js';
|
||||
import { mapActions } from 'vuex';
|
||||
import ErrorDialog from '@/dialogues/standard/ErrorDialog.vue';
|
||||
|
||||
export default {
|
||||
name: 'HomeNoLoginView',
|
||||
@@ -60,6 +62,7 @@ export default {
|
||||
RandomChatDialog,
|
||||
RegisterDialog,
|
||||
PasswordResetDialog,
|
||||
ErrorDialog,
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['login']),
|
||||
@@ -73,8 +76,16 @@ export default {
|
||||
this.$refs.passwordResetDialog.open();
|
||||
},
|
||||
async doLogin() {
|
||||
const response = await apiClient.post('/api/auth/login', { username: this.username, password: this.password });
|
||||
this.login(response.data);
|
||||
try {
|
||||
const response = await apiClient.post('/api/auth/login', { username: this.username, password: this.password });
|
||||
this.login(response.data);
|
||||
if (response.data.forwardDataInput) {
|
||||
console.log(response.data);
|
||||
this.$router.push({ path: '/settings/personal' });
|
||||
}
|
||||
} catch (error) {
|
||||
this.$refs.errorDialog.open(`tr:error.${error.response.data.error}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
11
frontend/src/views/settings/PersonalView.vue
Normal file
11
frontend/src/views/settings/PersonalView.vue
Normal file
@@ -0,0 +1,11 @@
|
||||
<template>
|
||||
<div>
|
||||
Persönliche Einstellungen
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'PersonalSettingsView',
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user