Improved handling of unexpected events

This commit is contained in:
Alicia Sykes
2021-09-12 16:33:29 +01:00
parent affff262d3
commit e9aa2bb7fc
5 changed files with 16 additions and 2 deletions

View File

@@ -76,6 +76,7 @@ import router from '@/router';
import Button from '@/components/FormElements/Button';
import Input from '@/components/FormElements/Input';
import Defaults, { localStorageKeys } from '@/utils/defaults';
import { InfoHandler } from '@/utils/ErrorHandler';
import {
checkCredentials,
login,
@@ -157,6 +158,9 @@ export default {
if (response.correct) { // Yay, credentials were correct :)
login(this.username, this.password, timeout); // Login, to set the cookie
this.goHome();
InfoHandler(`Succesfully signed in as ${this.username}`, 'Authentication');
} else {
InfoHandler(`Unable to Sign In - ${this.message}`, 'Authentication');
}
},
/* Calls function to double-check guest access enabled, then log in as guest */