This commit is contained in:
2018-11-06 23:54:47 +00:00
parent 3c0f696c68
commit dadeb45342
5 changed files with 173 additions and 97 deletions

View File

@@ -22,23 +22,34 @@ export default {
methods: {
login() {
if (this.input.username != "" && this.input.password != "") {
// eslint-disable-next-line
var response = auth.authenticate(
this.input.username,
this.input.password
);
if (
this.input.username == this.$store.state.mockAccount.username &&
this.input.password == this.$store.state.mockAccount.password
auth.authenticate(this.input.username, this.input.password, function(
data
) {
this.$emit("authenticated", true);
this.$router.replace({ name: "secure" });
} else {
alert("The username and / or password is incorrect");
}
} else {
alert("A username and password must be present");
// eslint-disable-next-line
console.log("LOGIN.VUE::login() -> CB VERSION DATA:", data);
});
// if (
// this.input.username == this.$store.state.mockAccount.username &&
// this.input.password == this.$store.state.mockAccount.password
// ) {
// this.$emit("authenticated", true);
// this.$router.replace({ name: "secure" });
// } else {
// alert("The username and / or password is incorrect");
// }
// } else {
// alert("A username and password must be present");
auth
.authenticatepromise(this.input.username, this.input.password)
.then(response => {
// eslint-disable-next-line
console.log(
"LOGIN.VUE::login() -> PROMISE VERSION RESPONSE:",
response
);
});
}
}
}