diff --git a/src/views/Login.vue b/src/views/Login.vue index ae0f78d..bb4c90a 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -9,24 +9,40 @@
-
- -
-
-
- + No remote sources defined +
+
+ No remote sources enabled for login +
+
+
+
+ +
+
+
+ +
@@ -58,6 +74,22 @@ export default { remotesources: null }; }, + computed: { + hasRemoteSources() { + if (this.remotesources) { + return this.remotesources.length > 0; + } + return false; + }, + hasLoginRemoteSources() { + for (let rs of this.remotesources) { + if (rs.login_enabled) { + return true; + } + } + return false; + } + }, methods: { async fetchRemoteSources() { let { data, error } = await fetchRemoteSources(); diff --git a/src/views/Register.vue b/src/views/Register.vue index a51e859..8f15a95 100644 --- a/src/views/Register.vue +++ b/src/views/Register.vue @@ -12,10 +12,29 @@
+
+ No remote sources defined +
+
+ No remote sources enabled for registration +
Register with {{rs.name}} + > + Register with {{ rs.name }} +
@@ -68,7 +89,22 @@ export default { }; }, computed: { - ...mapGetters(["registeruser"]) + ...mapGetters(["registeruser"]), + + hasRemoteSources() { + if (this.remotesources) { + return this.remotesources.length > 0; + } + return false; + }, + hasRegisterRemoteSources() { + for (let rs of this.remotesources) { + if (rs.registration_enabled) { + return true; + } + } + return false; + } }, methods: { async fetchRemoteSources() { @@ -81,14 +117,16 @@ export default { }, async doAuthorize(remotesourcename, username, password) { let u = authorizeurl(); - let res = await (await fetch(u, { - method: "POST", - body: JSON.stringify({ - remote_source_name: remotesourcename, - login_name: username, - password: password + let res = await ( + await fetch(u, { + method: "POST", + body: JSON.stringify({ + remote_source_name: remotesourcename, + login_name: username, + password: password + }) }) - })).json(); + ).json(); if (res.oauth2_redirect) { window.location = res.oauth2_redirect;