fully implement 2factor auth

This commit is contained in:
wh1te909
2020-01-19 22:24:38 +00:00
parent a9466050d3
commit f339abbb22
2 changed files with 16 additions and 3 deletions

View File

@@ -169,7 +169,7 @@ export const store = new Vuex.Store({
timeout: 1000,
textColor: "white",
icon: "fas fa-times-circle",
message: "Invalid credentials"
message: "Bad token"
});
reject(error);
});

View File

@@ -3,8 +3,8 @@
<div class="row text-center">
<div class="col"></div>
<div class="col">
<h5>Tactical Techs RMM</h5>
<q-form @submit.prevent="prompt = true" class="q-gutter-md">
<h5>Tactical RMM</h5>
<q-form @submit.prevent="checkCreds" class="q-gutter-md">
<q-input
outlined
v-model="credentials.username"
@@ -55,8 +55,12 @@
</template>
<script>
import axios from "axios";
import mixins from "@/mixins/mixins";
export default {
name: "Login",
mixins: [mixins],
data() {
return {
credentials: {},
@@ -65,6 +69,15 @@ export default {
},
methods: {
checkCreds() {
axios.post("/checkcreds/", this.credentials)
.then(r => {
this.prompt = true;
})
.catch(() => {
this.notifyError('Bad credentials')
})
},
onSubmit() {
this.$store
.dispatch("retrieveToken", this.credentials)