This commit is contained in:
@@ -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
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user