From 886a939b02c38b5caa222d47f68033fd0cbaf799 Mon Sep 17 00:00:00 2001
From: Phil Hughes <me@iamphill.com>
Date: Wed, 14 Dec 2016 16:59:36 +0000
Subject: [PATCH] Username exists check respects the relative root URL

Closes #25548
---
 app/assets/javascripts/username_validator.js.es6 | 2 +-
 changelogs/unreleased/username-exists-root.yml   | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
 create mode 100644 changelogs/unreleased/username-exists-root.yml

diff --git a/app/assets/javascripts/username_validator.js.es6 b/app/assets/javascripts/username_validator.js.es6
index c4dde575c6e..609dec12412 100644
--- a/app/assets/javascripts/username_validator.js.es6
+++ b/app/assets/javascripts/username_validator.js.es6
@@ -77,7 +77,7 @@
         this.renderState();
         return $.ajax({
           type: 'GET',
-          url: `/users/${username}/exists`,
+          url: `${gon.relative_url_root}/users/${username}/exists`,
           dataType: 'json',
           success: (res) => this.setAvailabilityState(res.exists)
         });
diff --git a/changelogs/unreleased/username-exists-root.yml b/changelogs/unreleased/username-exists-root.yml
new file mode 100644
index 00000000000..1ffb3eb435c
--- /dev/null
+++ b/changelogs/unreleased/username-exists-root.yml
@@ -0,0 +1,4 @@
+---
+title: Username exists check respects relative root path
+merge_request: 
+author: 
-- 
GitLab