[Login] Fehlermeldung bei falschen Credentials
This commit is contained in:
parent
60417f6585
commit
306ae7648d
|
@ -7,6 +7,10 @@ export default boot<Store<StateInterface>>(({ router, store }) => {
|
|||
router.beforeEach((to, from, next) => {
|
||||
const session = store.state.session.currentSession;
|
||||
|
||||
if (to.path == from.path) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (to.path.startsWith('/main')) {
|
||||
// Secured area (LOGIN REQUIRED)
|
||||
// Check login is ok
|
||||
|
|
|
@ -60,7 +60,7 @@ export default defineComponent({
|
|||
})
|
||||
.then(() => {
|
||||
const x = root.$route.query['redirect'];
|
||||
void root.$router.replace(
|
||||
void root.$router.push(
|
||||
typeof x === 'string' ? { path: x } : mainRoute
|
||||
);
|
||||
})
|
||||
|
|
|
@ -5,6 +5,7 @@ import { axios } from 'src/boot/axios';
|
|||
import { AxiosError, AxiosResponse } from 'axios';
|
||||
import { Router } from 'src/router';
|
||||
import { LocalStorage } from 'quasar';
|
||||
import { Notify } from 'quasar';
|
||||
|
||||
export interface SessionInterface {
|
||||
currentSession?: FG.Session;
|
||||
|
@ -66,6 +67,15 @@ const actions: ActionTree<SessionInterface, StateInterface> = {
|
|||
commit('user/setCurrentPermissions', response.data.permissions, {
|
||||
root: true
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
Notify.create({
|
||||
type: 'negative',
|
||||
message: 'Benutzername oder Passwort sind falsch.',
|
||||
timeout: 10000,
|
||||
progress: true,
|
||||
actions: [{ icon: 'mdi-close', color: 'white' }]
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue