diff --git a/app/assets/javascripts/ide/components/oauth_application_callout.vue b/app/assets/javascripts/ide/components/oauth_application_callout.vue
index 89805a434bfab27092cf11644b4129995046029e..56b51c0ca194065f1b93ba3cc73ca6fc77f9ec69 100644
--- a/app/assets/javascripts/ide/components/oauth_application_callout.vue
+++ b/app/assets/javascripts/ide/components/oauth_application_callout.vue
@@ -49,7 +49,7 @@ export default {
       this.isModalVisible = false;
     },
     getRedirectUrl() {
-      return new URL(this.redirectUrlPath, window.location.origin);
+      return new URL(this.redirectUrlPath, gon.gitlab_url);
     },
   },
   i18n: I18N_WEB_IDE_OAUTH_APPLICATION_CALLOUT,