From commits-return-23234-archive-asf-public=cust-asf.ponee.io@airavata.apache.org Mon Oct 12 23:34:43 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-ec2-va.apache.org (mxout1-ec2-va.apache.org [3.227.148.255]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 1661B18064E for ; Tue, 13 Oct 2020 01:34:43 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with SMTP id 53464428E6 for ; Mon, 12 Oct 2020 23:34:42 +0000 (UTC) Received: (qmail 54094 invoked by uid 500); 12 Oct 2020 23:34:42 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 54085 invoked by uid 99); 12 Oct 2020 23:34:42 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Oct 2020 23:34:42 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id F22C981A7C; Mon, 12 Oct 2020 23:34:41 +0000 (UTC) Date: Mon, 12 Oct 2020 23:34:41 +0000 To: "commits@airavata.apache.org" Subject: [airavata-custos-portal] branch ux-improvement updated: gh-37: Adding a $route listener to the header component that validates the user MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <160254568192.20586.4662865691702453473@gitbox.apache.org> From: isjarana@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: airavata-custos-portal X-Git-Refname: refs/heads/ux-improvement X-Git-Reftype: branch X-Git-Oldrev: 9b541e078f61e8557e8636c818f1417f4a5998a9 X-Git-Newrev: 3968827c85a11d3a71d0c133098362e76b598b7e X-Git-Rev: 3968827c85a11d3a71d0c133098362e76b598b7e X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. isjarana pushed a commit to branch ux-improvement in repository https://gitbox.apache.org/repos/asf/airavata-custos-portal.git The following commit(s) were added to refs/heads/ux-improvement by this push: new 3968827 gh-37: Adding a $route listener to the header component that validates the user new 73b1015 Merge pull request #56 from dinukadesilva/gh-37-fix-top-header-component 3968827 is described below commit 3968827c85a11d3a71d0c133098362e76b598b7e Author: Dinuka De Silva AuthorDate: Tue Oct 13 02:00:45 2020 +0530 gh-37: Adding a $route listener to the header component that validates the user --- custos-demo-gateway/src/components/Callback.vue | 32 +------ custos-demo-gateway/src/components/Header.vue | 98 +++++++++++----------- .../src/components/landing/Landing.vue | 22 +---- .../src/components/workspace/Workspace.vue | 24 ------ 4 files changed, 51 insertions(+), 125 deletions(-) diff --git a/custos-demo-gateway/src/components/Callback.vue b/custos-demo-gateway/src/components/Callback.vue index ba63380..f4f3800 100644 --- a/custos-demo-gateway/src/components/Callback.vue +++ b/custos-demo-gateway/src/components/Callback.vue @@ -46,37 +46,9 @@ this.custosSec = config.value('clientSec') this.redirectURI = config.value('redirectURI') this.tokenEndpoint = "https://custos.scigap.org/apiserver/identity-management/v1.0.0/token" + await this.authenticate() - console.log("calling authenticate") - if (this.isAuthenticated) { - console.log("calling authenticated") - let username = await this.$store.dispatch('identity/getCurrentUserName') - await this.$router.push('workspace') - let data = { - offset: 0, limit: 1, client_id: this.custosId, client_sec: this.custosSec, - username: username - } - let resp = await this.$store.dispatch('user/users', data) - console.log(resp) - if (Array.isArray(resp) && resp.length > 0) { - resp.forEach(user => { - let dat = { - client_id: this.custosId, - client_sec: this.custosSec, - body: { - username: user.username, - first_name: user.first_name, - last_name: user.last_name, - email: user.email, - } - } - console.log(dat) - this.$store.dispatch('user/updateUserProfile', dat) - }) - } - } else { - await this.$router.push('home') - } + await this.$router.push('workspace') } } diff --git a/custos-demo-gateway/src/components/Header.vue b/custos-demo-gateway/src/components/Header.vue index 266fc30..0fe1acd 100644 --- a/custos-demo-gateway/src/components/Header.vue +++ b/custos-demo-gateway/src/components/Header.vue @@ -51,19 +51,14 @@ diff --git a/custos-demo-gateway/src/components/landing/Landing.vue b/custos-demo-gateway/src/components/landing/Landing.vue index 720d1ad..4a4a0b3 100644 --- a/custos-demo-gateway/src/components/landing/Landing.vue +++ b/custos-demo-gateway/src/components/landing/Landing.vue @@ -87,7 +87,6 @@ } }, methods: { - async login() { this.loginDisabled = true if (this.username != null && this.username != '' && this.password != null && this.password != '') { @@ -102,11 +101,7 @@ await this.$store.dispatch('identity/authenticateLocally', params) let resp = await this.$store.dispatch('identity/isAuthenticated', data) if (resp) { - - // TODO fix in https://github.com/apache/airavata-custos-portal/issues/37 - window.location.reload() - - // await this.$router.push('workspace') + await this.$router.push('workspace') } else { this.loginError = true } @@ -115,8 +110,6 @@ } this.loginDisabled = false }, - - async callDismissed() { this.loginError = false }, @@ -126,7 +119,6 @@ window.location.href = this.$store.getters['identity/getAuthorizationEndpoint'] } }, - async mounted() { this.custosId = config.value('clientId') this.custosSec = config.value('clientSec') @@ -136,20 +128,10 @@ client_id: this.custosId, client_sec: this.custosSec } - if (await store.dispatch('identity/isAuthenticated', data) == true) { - + if (await store.dispatch('identity/isAuthenticated', data) === true) { await this.$router.push('workspace') } - - }, - - computed: { - // ...mapGetters({ - // - // }) } - - } diff --git a/custos-demo-gateway/src/components/workspace/Workspace.vue b/custos-demo-gateway/src/components/workspace/Workspace.vue index 041c98a..13d5eb1 100644 --- a/custos-demo-gateway/src/components/workspace/Workspace.vue +++ b/custos-demo-gateway/src/components/workspace/Workspace.vue @@ -44,8 +44,6 @@