This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable no-console */
|
||||
|
||||
//INFO: https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa
|
||||
import { register } from "register-service-worker";
|
||||
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
prepend-icon="fa-user"
|
||||
label="User"
|
||||
required
|
||||
clearable
|
||||
autocomplete="off"
|
||||
autocorrect="off"
|
||||
autocapitalize="off"
|
||||
spellcheck="false"
|
||||
:error="errorBadCreds"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex>
|
||||
@@ -27,6 +33,8 @@
|
||||
label="Password"
|
||||
type="password"
|
||||
required
|
||||
clearable
|
||||
:error="errorBadCreds"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex class="text-xs-center" mt-1>
|
||||
@@ -51,12 +59,15 @@ export default {
|
||||
input: {
|
||||
username: "manager",
|
||||
password: "l3tm3in"
|
||||
}
|
||||
},
|
||||
errorBadCreds: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
login() {
|
||||
if (this.input.username != "" && this.input.password != "") {
|
||||
this.errorBadCreds = false;
|
||||
var that = this;
|
||||
auth
|
||||
.authenticate(this.input.username, this.input.password)
|
||||
.then(() => {
|
||||
@@ -64,8 +75,15 @@ export default {
|
||||
})
|
||||
.catch(function(error) {
|
||||
/* xeslint-disable-next-line */
|
||||
if (
|
||||
error.message &&
|
||||
error.message.includes("ErrorUserNotAuthenticated")
|
||||
) {
|
||||
that.errorBadCreds = true;
|
||||
// alert("BAD CREDENTIALS - BOO!");
|
||||
}
|
||||
//console.log(error);
|
||||
alert("login failed: " + error);
|
||||
// alert("login failed: " + error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user