finish up user management
This commit is contained in:
parent
74c1d40dae
commit
905d443c7d
|
@ -26,8 +26,7 @@ class CheckCreds(KnoxLoginView):
|
|||
def post(self, request, format=None):
|
||||
serializer = AuthTokenSerializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
|
||||
user = get_object_or_404(User, username=request.data["username"])
|
||||
user = serializer.validated_data["user"]
|
||||
|
||||
if not user.totp_key:
|
||||
return Response("totp not set")
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div style="width: 900px; max-width: 90vw;">
|
||||
<q-card>
|
||||
<q-bar>
|
||||
<q-btn ref="refresh" @click="refresh" class="q-mr-sm" dense flat push icon="refresh" />Administration
|
||||
<q-btn ref="refresh" @click="refresh" class="q-mr-sm" dense flat push icon="refresh" />User Administration
|
||||
<q-space />
|
||||
<q-btn dense flat icon="close" v-close-popup>
|
||||
<q-tooltip content-class="bg-white text-primary">Close</q-tooltip>
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
</q-item>
|
||||
<!-- admin manager -->
|
||||
<q-item clickable v-close-popup @click="showAdminManager = true">
|
||||
<q-item-section>Administration</q-item-section>
|
||||
<q-item-section>User Administration</q-item-section>
|
||||
</q-item>
|
||||
<!-- core settings -->
|
||||
<q-item clickable v-close-popup @click="showEditCoreSettingsModal = true">
|
||||
|
@ -170,7 +170,7 @@ export default {
|
|||
AutomationManager,
|
||||
InstallAgent,
|
||||
UploadMesh,
|
||||
AdminManager
|
||||
AdminManager,
|
||||
},
|
||||
props: ["clients"],
|
||||
data() {
|
||||
|
@ -184,7 +184,7 @@ export default {
|
|||
showAutomationManager: false,
|
||||
showAdminManager: false,
|
||||
showInstallAgent: false,
|
||||
showUploadMesh: false
|
||||
showUploadMesh: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
@ -200,7 +200,7 @@ export default {
|
|||
},
|
||||
edited() {
|
||||
this.$emit("edited");
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<q-card style="width: 60vw">
|
||||
<q-form ref="form" @submit="submit">
|
||||
<q-form ref="form" @submit="onSubmit">
|
||||
<q-card-section class="row items-center">
|
||||
<div class="text-h6">{{ title }}</div>
|
||||
<q-space />
|
||||
|
@ -113,9 +113,8 @@ export default {
|
|||
this.last_name = r.data.last_name;
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
onSubmit() {
|
||||
this.$q.loading.show();
|
||||
|
||||
let formData = {
|
||||
id: this.pk,
|
||||
username: this.username,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<q-card style="width: 60vw">
|
||||
<q-form ref="form" @submit="submit">
|
||||
<q-form ref="form" @submit="onSubmit">
|
||||
<q-card-section class="row items-center">
|
||||
<div class="text-h6">{{ username }} Password Reset</div>
|
||||
<q-space />
|
||||
|
@ -47,9 +47,8 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
onSubmit() {
|
||||
this.$q.loading.show();
|
||||
|
||||
let formData = {
|
||||
id: this.pk,
|
||||
password: this.password,
|
||||
|
|
|
@ -70,7 +70,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
credentials: {},
|
||||
prompt: false
|
||||
prompt: false,
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -80,9 +80,8 @@ export default {
|
|||
.post("/checkcreds/", this.credentials)
|
||||
.then(r => {
|
||||
if (r.data === "totp not set") {
|
||||
this.$router.push({name: "TOTPSetup", params: { username: this.credentials.username }})
|
||||
this.$router.push({ name: "TOTPSetup", params: { username: this.credentials.username } });
|
||||
} else {
|
||||
|
||||
this.prompt = true;
|
||||
}
|
||||
})
|
||||
|
@ -102,11 +101,11 @@ export default {
|
|||
this.credentials = {};
|
||||
this.prompt = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.$q.dark.set(true);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue