From 8f3ed10cef8188d49ca792c48da6f2d577e6bf41 Mon Sep 17 00:00:00 2001 From: Open Source Developer Date: Sat, 11 Mar 2017 13:45:41 +0200 Subject: [PATCH] username --- drupal/modules/epal/epal.routing.yml | 6 +++--- source/components/home.ts | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drupal/modules/epal/epal.routing.yml b/drupal/modules/epal/epal.routing.yml index d757f92..e3475f5 100644 --- a/drupal/modules/epal/epal.routing.yml +++ b/drupal/modules/epal/epal.routing.yml @@ -24,12 +24,12 @@ epal_auth_test: _user_is_logged_in: 'TRUE' current_user: path: '/epal/curuser/{token_name}' - options: - _auth: ['basic_auth' ] + options: + _auth: [ 'basic_auth' ] defaults: _controller: '\Drupal\epal\Controller\CurrentUser::content' requirements: - _user_is_logged_in: 'TRUE' + _access: 'TRUE' epal.application_submit: path: '/epal/appsubmit' options: diff --git a/source/components/home.ts b/source/components/home.ts index ca68e66..46832fa 100644 --- a/source/components/home.ts +++ b/source/components/home.ts @@ -90,8 +90,7 @@ export default class Home implements OnInit { state.loginInfo.reduce(({}, loginInfoToken) => { this.authToken = loginInfoToken.auth_token; this.authRole = loginInfoToken.auth_role; - if (this.authToken && this.authToken.length > 0) - this.router.navigate(['/epal-class-select']); + return loginInfoToken; }, {}); } @@ -111,7 +110,9 @@ export default class Home implements OnInit { if (this.authToken && this.authRole) this._ata.getloginInfo({ auth_token: this.authToken, auth_role: this.authRole}); - + console.log(this.authToken, "tttttttt"); + if (this.authToken && this.authToken.length > 0) + this.router.navigate(['/epal-class-select']); // this._ata.saveLoginInfo({ auth_token: this.authToken, auth_role: this.authRole, cu_name:this.name }); }); -- GitLab