Skip to content
Snippets Groups Projects
Commit 9da6f54d authored by Larbi Gharib's avatar Larbi Gharib
Browse files

Username lowercase ns check

Change-Id: Iaeaf211b5d2e4e8e775e23cffcd784fd6411db7a
parent ae7c0845
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,7 @@ const api_path_delete_admin_contacts = "/api/admin/contacts";
const api_path_blueprints = "/api/admin/policy";
const api_path_get_user_profile = "/api/auth/userprofile/";
const api_path_get_ns_name_from_addr = "/api/nameserver/addr/";
const api_path_get_ns_addr_from_name = "/api/nameserver/name/";
module.exports = {
uri,
......@@ -100,4 +101,5 @@ module.exports = {
api_path_blueprints,
api_path_get_user_profile,
api_path_get_ns_name_from_addr,
api_path_get_ns_addr_from_name,
};
......@@ -61,7 +61,7 @@ import {
api_path_post_create_user,
api_path_post_create_user_profile,
api_path_get_user_profile,
api_path_get_exists_user,
api_path_get_ns_addr_from_name,
} from "../../globalUrls";
import dashboardStyle from "assets/jss/material-dashboard-react/views/dashboardStyle.js";
......@@ -248,6 +248,7 @@ export default function EditCreateUserProfile(props) {
};
const handleCreateUser = (data) => {
data.username = data.username.toLowerCase();
const body = {
username: data.username,
password: data.password,
......@@ -334,7 +335,14 @@ export default function EditCreateUserProfile(props) {
const data = {
username: value.toLowerCase(),
};
axios(configApiCall(api_path_get_exists_user, "GET", data, null))
axios(
configApiCall(
api_path_get_ns_addr_from_name + data.username,
"GET",
null,
null
)
)
.then((response) => {
if (response.status === 200) {
resolve(false);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment